Skip to content

Using Schema.NET in ASP.NET Core controllers in model binding #2

Open
@veikkoeeva

Description

@veikkoeeva

Hi!

I was wondering if you would have advice on how to use this interesting library in ASP.NET Core controllers so that roughly the following would work:

[HttpPost("[action]")]
public IActionResult Test([FromBody] Thing thing)
{
    var e = (Person)thing;
    return Accepted(new Uri("https://wwww.WhereToAskForResults.com"));
}

That is, accept JSON-LD data via a base classes. Or put other way, if I have a JSON document, say like at https://jsonld.com/person/, how could it be deserialized to a .NET object of Person.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIssues describing an enhancement or pull requests adding an enhancement.good first issueA good first issue for a new community member to take on.help wantedHelp wanted from the community.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions