Jump to content
KostasR

How to use Swagger via MARS REST API?

Recommended Posts

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

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

 

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 by KostasR

Share this post


Link to post

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 your get.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×