When the discriminator isn't at the top level, the request sample doesn't show all fields.
Example:
In the default pet store, in the POST /pet, we see that huntingSkill is present, a specific field from petType=Cat
{
"id": 0,
"category": {
"id": 0,
"name": "string",
"sub": {
"prop1": "string"
}
},
"name": "Guru",
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available",
"petType": "Cat",
"huntingSkill": "lazy"
}
Nesting the petType from line 107 like this, for example:
-$ref: '#/definitions/Pet'
+type: object
+properties:
+ foo:
+ $ref: '#/definitions/Pet'
We don't get the huntingSkill in the request sample:
{
"foo": {
"id": 0,
"category": {
"id": 0,
"name": "string",
"sub": {
"prop1": "string"
}
},
"name": "Guru",
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available",
"petType": "string"
}
}
@queimadus good catch!
I can verify this bug. Will try to fix for the next-week release
@RomanGotsiy any update on this?
It appeared to be not so simple to fix :(
Will get another try later this week. Ping me again if I don't answer till the end of the week!
Thanks!
@RomanGotsiy Any progress with this?
@RomanGotsiy is this fixed in Redoc 2.0?
Most helpful comment
@queimadus good catch!
I can verify this bug. Will try to fix for the next-week release