Redoc: Partial request sample with nested discriminator

Created on 1 Aug 2017  路  5Comments  路  Source: Redocly/redoc

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"
  }
}
bug

Most helpful comment

@queimadus good catch!

I can verify this bug. Will try to fix for the next-week release

All 5 comments

@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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shreyas-agnihotri picture shreyas-agnihotri  路  3Comments

JFCote picture JFCote  路  3Comments

skllcrn picture skllcrn  路  3Comments

karussell picture karussell  路  3Comments

typekpb picture typekpb  路  4Comments