Skip to content
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

Siblings of $ref do not override the referenced object #2042

Closed
atruskot opened this issue Jun 3, 2022 · 2 comments · Fixed by #2063 or #2112
Closed

Siblings of $ref do not override the referenced object #2042

atruskot opened this issue Jun 3, 2022 · 2 comments · Fixed by #2063 or #2112

Comments

@atruskot
Copy link

atruskot commented Jun 3, 2022

Describe the bug
Note: this is a duplicate of #1727. I'm not sure if this community prefers to reopen closed issues or create a new issue after closing the original. Feel free to close this issue if the preference is to reopen the original.

I'm still able to reproduce this issue in redoc-cli@0.13.16. Seeing the base description rather than the sibling/overridden one. Will see the sibling description if the base has no description.

Worth noting, the issue isn't specific to description, any base property will render if it exists. So base examples can't be overridden either, for example. I'm not sure if the expectation is for the derived object to be arbitrarily override any base property or if Redoc is expected to only override specific properties (such as description).

Expected behavior
When there are siblings of $ref, it is expected that the siblings override any properties that are also founded in the referenced object.

Minimal reproducible OpenAPI snippet(if possible)
Described in #1727.

@bvisness
Copy link

It looks like OpenAPI versions before 3.1 did not allow any siblings to $ref. But, 3.1 explicitly allows summary and description, so those should override the summary and description of the referenced object if applicable.

Relevant spec sections:

@AlexVarchuk
Copy link
Collaborator

AlexVarchuk commented Jun 14, 2022

The 3.1 include JSON Schema draft 2020-12 which allows all keywords siblings inside the schema object. But the sibling keywords do not override the keywords in the referenced schema, they add to them. Link to issue .

In OpenApi 3.1 spec the summary and description should override the referenced object.

I think correct behavior:

  • overriding description and summary in any part of the definition
  • add keywords inside the schema object(draft 2020-12).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants