Hi, for some routes we need multiple examples for a "Response Object" as well as multiple body payload examples in the "Parameter Object".
e.g: our API route returns an object with optional properties and we want to show 2 examples how it could look like ...
...
{
...
"examples" : [
{
"application/json" :
{
"property" : "value"
}
},
{
"application/json" :
{
"property" : "value",
"optional_property" : "value"
}
}
]
...
}
In addition we would like to name/label these examples .
In the specification "Example Object"s you can specify different representations of an example for a given MIME-type. I would suggest adding either an optional "name" or "label" property to the "Example Object" which is a string (maybe even an object to allow localized string values for different languages) or to allow custom properties (e.g x-name).
e.g:
...
{
...
"examples" : [
{
"application/json" :
{
"property" : "value"
},
"name" : "Default Response"
},
{
"application/json" :
{
"property" : "value",
"optional_property" : "value"
},
"name" : "Response if state of ressource ..."
}
]
...
}
If there is any good way to solve it with the current swagger specification, i would love to hear it and it would make this feature request obsolete.
Thanks.
Hi, for some routes we need multiple examples for a "Response Object" as well as multiple body payload examples in the "Parameter Object".
e.g: our API route returns an object with optional properties and we want to show 2 examples how it could look like ...
In addition we would like to name/label these examples .
In the specification "Example Object"s you can specify different representations of an example for a given MIME-type. I would suggest adding either an optional "name" or "label" property to the "Example Object" which is a string (maybe even an object to allow localized string values for different languages) or to allow custom properties (e.g x-name).
e.g:
If there is any good way to solve it with the current swagger specification, i would love to hear it and it would make this feature request obsolete.
Thanks.