Forum Discussion
andreiclara
New Contributor
Thank you for your answer, but I don't understand where I can add this example. I was trying to add example in external file "examples.json". The code above should be added in "examples.json" or in swagger.yaml? And what section should I add it? In the responses or schema examples?
Thank you
chichepo
3 years agoChampion Level 1
Hi andreiclara
the examples are defined under the components clause as shown here
look here for further examples.
Another solution is to save your examples collection within a domain.
In such case, your Domain is defining all your "reusable" definitions, under the components clause.
For example:
In the API file:
In the Domain file:
Let us know if it is enough clear
Related Content
- 10 months ago
Recent Discussions
- 16 days ago
- 2 months ago