redoc icon indicating copy to clipboard operation
redoc copied to clipboard

Build-Docs OneOf Example

Open thecork3004 opened this issue 7 months ago • 4 comments

I hope I explain my issue, because I must admit I don't know much about openapi and am simply trying to convert some files provided by my dev team to HTML to share with customers so please bare with me if i use incorrect terminology throughout.

The issue I'm having is that one of my endpoints is utilising oneOf in its schema.

When we look at the endpoint in swaggerhub, the "Example" that is presented, is of the first in the list of "oneOfs" which is what we would expect. When I convert this to html using redocly, I see two buttons next to "one of" called "In Request" which when selected dynamically presents the correct schema below, but the example on the right hand side does not change, and counterintuitively shows the 2nd of the two oneOf options, the opposite of what swaggerhub does. I find this counter intuitive because when the page is loaded, the "first" option is always selected, and yet the example is of the 2nd (in my case) of the options.

My questions are the following:

  1. Is this expected behaviour or an issue?
  2. Can the example be set to change when the buttons are selected just like the schema does
  3. Can the buttons be labelled rather than just both be called "In Request"

Thanks, i really appreciate if anyone can give me guidance and again apologies if this is not explained properly from my unknowledgeable perspective.

thecork3004 avatar Jul 23 '24 14:07 thecork3004