How to do multiple parameters in OpenAPI with examples #1529
Replies: 2 comments 1 reply
-
Hey there! We have an issue related to OData that should match your needs here: #1522 |
Beta Was this translation helpful? Give feedback.
-
Hi! |
Beta Was this translation helpful? Give feedback.
-
For example this path in the OpenAPI definition file
"/OData/CatsByGroup(countryId={countryId},groupId={groupId})"
In the parameters, I have this
"parameters": [
{
"name": "countryId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"examples":{
"my_cats":{
"value":"Brazil"
}
}
},
{
"name": "groupId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"examples":{
"my_cats":{
"value":"Gray"
}
}
},
And in the responses section I have this:
"200": {
"description": "Cats per group",
"content": {
"application/json": {
"schema": {
"properties": {
"@odata.context": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CatResource"
}
}
}
},
"examples":{
"my_cats":{
"value":
{
"value": [
{
"UniqueId": "67677445-a76d-4832-ad85-924b12345d64",
"CountryId": "Brazil",
"GroupId": "Gray",
"Description": "Lovely cat"
},
{
"UniqueId": "91aace39-8f42-4eb7-9bec-b004848084a9",
"ApplicationId": "Brazil",
"GroupId": "Gray",
"Description": "Outdoor cat"
},.........
Is this correct?
I tried this and it doesn't return my response. It does not error either. What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions