Open typekpb opened 8 years ago
@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
Steps to reproduce:
pet
->Add a new pet to the store
petType
from:Cat
toDog
Is: Secton
Request samples
doesn't reflect the change (Cat is still there, instead of Dog)Expected: Secton
Request samples
reflects the change