Hi there, I am wondering how to create example value for parameter input in a swagger?
regards and thanks
You can’t directly edit that “Example Value” box in OutSystems; it’s generated from your method’s input structure and the sample values you set for its attributes.
To influence what appears there, you need to change the default/sample values of the structure that is used as the body parameter of the REST method.
Here’s how to do it in O11:
Find the structure used in the body
POST /contacts
Set sample/default values on the attributes
Contact
Birthday
Title
"Mr."
Name
"John Doe"
Gender
"Male"
#2014-12-31#
Email
"john.doe@example.com"
OutSystems uses these values when generating the Example Value and Model in the documentation for JSON bodies. [[REST API Structures<https://success.outsystems.com/documentation/11/developing_an_application/integration/consuming_rest_apis/rest_api_structures]]
Publish and re-check the documentation
Example Value
A couple of extra notes:
So in summary: define and maintain your example values at the structure attribute level in Service Studio; OutSystems uses those to generate the example JSON you see in Swagger/UI.