Consider the following response rendering (this is not related to the oneOf selectors, but they show that there are previously defined schema objects at play here):

In my definition, all the objects have a description. However, the description never seems to be rendered anywhere.
I suggest rendering the object's description wherever relevant, e.g. just above the property list shown in the screenshot.
I am curious as to what your actual schema looks like. I don't really have any help/solution for you here, but I can't seem to get names to appear in the oneOf selectors, they all simply say object. How did you get it to say ErrorAB and ErrorC etc.?
It's title, I think.
MyType:
title: foo
oneOf:
...
@cmeeren thanks, but title is not the same. I also want to describe my requests within onOf and change my description at the top level of the method.
paths:
/method:
post:
description: My default description
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/RequestOne'
- $ref: '#/components/schemas/RequestTwo'
components:
schemas:
RequestOne:
title: My first request
description: My optional description for the first method
RequestSecond:
title: My second request
description: My optional description for the second method
I think we're talking about different things here. This issue is about rendering object descriptions in the first place. It has nothing to do with oneOf (as stated in the OP), because currently, object descriptions are not rendered at all. I suggest we stick to the topic, and that you use another issue for the oneOf-related question. 馃檪
Or maybe this could be something toggable via the options. But either way I agree it would be very useful to be able to have this.
This will be fixed by https://github.com/Redocly/redoc/pull/1035 or https://github.com/Redocly/redoc/pull/1231 (both are waiting reviews though).
Most helpful comment
Or maybe this could be something toggable via the options. But either way I agree it would be very useful to be able to have this.