-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build-Docs OneOf Example #2563
Comments
Hi @thecork3004, this is a Redoc issue. Will transfer it to the correct repo. |
Any help here? |
Hi @thecork3004,
In the second scenario, you will utilize certain components, and then the name of a component will be used as a label.
If you have any more questions, please ping me. I hope I can help you. |
You can also achieve the button naming by using the openapi: 3.0.3
info:
title: '2563'
version: '0.0.1'
servers:
- url: https://redocly.com
paths:
'/thing':
get:
summary: testing labels using title attribute
responses:
'200':
description: OK
content:
'application/json':
schema:
oneOf:
- title: this
type: object
additionalProperties: false
properties:
this:
type: string
- title: that
type: object
additionalProperties: false
properties:
that:
type: string
examples:
this:
value:
this: 'test'
that:
value:
that: 'test'
|
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:
Thanks, i really appreciate if anyone can give me guidance and again apologies if this is not explained properly from my unknowledgeable perspective.
The text was updated successfully, but these errors were encountered: