Swagger documentation with examples and model entities

0
Hi there, Has anyone been able to fill the “example” and “model” sections for parameters of REST endpoints in Swagger ? The only thing that I was able to set is the “description” section of each parameter, but it’s obviously not very practical … Thanks
asked
2 answers
0

Hi Francois, 

Just want to understand your question more clear 

When we are trying to create rest API , swagger will generate the example and model values as shown below 

 

In the example section, For each attribute, it shows some sample values. 

 

Is that you referring to or something else? If you could elaborate your question , It would be helpful to answer 

answered
2

To show examples in the swagger.json you should set the documentation of the operation:

 

Do note the three backticks before and after the json. ```

In the web-browser in <yourapplication>/rest-doc/ it will show up like this:

answered