-
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
What is consistent way to define property accepting object defined by $ref? #1060
Comments
|
@RomanHotsiy wow, thanks. Is there any motivation behind this solution? Is it a best practice? |
Well, here are some technical and semantic differences. First, it is important to understand what I just thought and using Now, why title is not shown in the first example. This is not a bug in Redoc and is an intended behaviour. Merging two schemas doesn't imply the resulting schema will have one of the subschemas title, e.g.:
The resulting schema title is neither
I hope this makes sense. |
@RomanHotsiy It's clear now. Thanks a lot! |
We've got requirement to pass response content objects as values for our properties, and looks like it is legal and describing it using $ref looks like reasonable idea.
But it isn't clear from the specs how it should be done and looks like we've got several approaches here.
Using allOf
allOf jsfidle example
And redoc rendered schema will be:
I don't like this aproach because we say that the property
And redoc doesn't show property title.
Using anyOf
anyOf jsfidle example
And redoc rendered schema will be:
I don't like this aproach because
So my queestion is - What is consistent way to define properties with $ref values?
The text was updated successfully, but these errors were encountered: