Redoc: Request samples reflects the change of `petType`

Created on 2 Sep 2016  路  4Comments  路  Source: Redocly/redoc

Steps to reproduce:

  1. navigate to: http://rebilly.github.io/ReDoc/
  2. pick pet -> Add a new pet to the store
  3. change petType from: Cat to Dog

Is:
SectonRequest samples doesn't reflect the change (Cat is still there, instead of Dog)

Expected:
SectonRequest samples reflects the change

enhancement

Most helpful comment

@typekpb thanks.
We definitely should implement it, but it requires some work to resolve all edge cases (e.g. discriminator inside discriminator)

All 4 comments

@typekpb thanks.
We definitely should implement it, but it requires some work to resolve all edge cases (e.g. discriminator inside discriminator)

As an appendix to this issue, one more use case.

I have an array of items as such:

  BatchRequest:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/BatchItem'

  BatchItem:
    type: object
    required:
    - type
    discriminator: type
    properties:
      type:
        type: string
        description: Batch item type for this message.

The example shows only:

{
  "items": [
    {
      "type": "string"
    }
  ]
}

...regardless of what is chosen in the message as the discriminator dropdown.

Here is the same comment I posted in two other issues (https://github.com/Rebilly/ReDoc/issues/210#issuecomment-302992902 and https://github.com/Rebilly/ReDoc/issues/207#issuecomment-302993122) about simplifying and improving the visualization for allOf, oneOf, anyOf and removing discriminator. If ReDoc supported one to one mapping of nested sections per each oneOf/anyOf/allOf, the same reflection could be applied to examples, when a user scrolls the "horizontal" carousel-like slider.

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vietnguyen010 picture vietnguyen010  路  3Comments

raderio picture raderio  路  4Comments

RomanHotsiy picture RomanHotsiy  路  3Comments

karussell picture karussell  路  3Comments

yuji38kwmt picture yuji38kwmt  路  3Comments