Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So lets say I have an endpoint like this:
public async Task<IActionResult> Test([FromBody]string jsonData)

How can I provide a json schema for
jsonData
parameter? Is it possible? I know that if I have a DTO then swagger scaffolds properties from an object, but this is not what I need. My input object is a json string, not a DTO and I need to describe this json string with a valid schema. How this can be achieved?

What I have tried:

So far I have tried to generate xml documentation, but it feels wrong. Is that possible to provide description for a parameter somewhere in an endpoint comment or something alike?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900