My question is simple. I have 2 schems with an example. I want to change the request body with the dropdown.
Actually everything is working. I have the list with examples displayed and the values in RequestBody change only if I write them as “value”.
If I specify examples as ref, the first example is loaded, but the second example is not shown when the value in the dropdown list changes.
Is this just not implemented, is this a bug or have I done something/configured something wrong?
Screenshot:
And Config examples:
"requestBody": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{"$ref": "#/components/schemas/reportexample1"},
{"$ref": "#/components/schemas/reportexample2"}
]
},
"examples": {
"reportexample1": {
"summary": "reportexample1",
"$ref": "#/components/schemas/reportexample1"
},
"reportexample2": {
"summary": "reportexample2",
"$ref": "#/components/schemas/reportexample2"
}
}
}
}
},
……
"components": {
"schemas": {
"reportexample1": {
"type": "object",
"properties": { .... }
},
"reportexample2": {
"type": "object",
"properties": { .... }
}
}
}