KostasR 1 Posted June 3 Is there documentation on how to use Swagger with the MARS REST API? For example, how can describe the body params in a POST method, such as string length, date format, required, etc. Share this post Link to post
Lars Fosdal 1858 Posted June 4 Not sure if I understand your question? Swagger is API documentation. Are you looking for how to generate code for MARS REST based on a Swagger definition? Share this post Link to post
KostasR 1 Posted June 4 (edited) I've looked at Demo OpenAPI. MARS builds a Swagger website with my resources. I have a POST method with a body param, containing the record. My question is now, how can I describe the fields of the record for swagger, i. e. the length of a string or the date format or if the field is required? Maybe with attributes? Is there any documentation? Edited June 4 by KostasR Share this post Link to post
Lars Fosdal 1858 Posted June 6 Ah, so how to generate complete Swagger info from your MARS API? Share this post Link to post
Lars Fosdal 1858 Posted June 6 I see there are several attributes relevant for the Swagger data, such as RequestParamAttribute, but I see very few examples of use. Github: search for "Param]" (without the quotes) I woud suggest you experiment with those to see what you get. Share this post Link to post
KostasR 1 Posted June 7 If I understand correctly, this isn't a question for the MARS API, but rather what is the definition in Swagger? I'll look into that. Thank you. Share this post Link to post