Why "all other properties in a "$ref" object are ignored"? #3087
Replies: 3 comments
-
Check 4.7.24 Reference Object
When I use different open-api documents from internet to test my parser I often see this rule broken. If you want to extend your schema, you shold use |
Beta Was this translation helpful? Give feedback.
-
OAS 3.0 inherited this behavior from the old (and long since expired) JSON Reference proposal. See #3526 (comment) for an explanation of why (for now) only |
Beta Was this translation helpful? Give feedback.
-
Since this was initially answered in 2022 with no further discussions, I'm going to close it as answered. |
Beta Was this translation helpful? Give feedback.
-
I was curious about why this is the case - I'm building an API from the ground up using Open API 3.0, and in some of my schemas I'm using compositional references to build the schemas, for example:
However, when editting using https://editor-next.swagger.io/, I'm getting errors on the lines such as
prepared_by
andapproved_by
, statingAll other properties in a "$ref" object are ignored
. In this case, it would seem to me that these fields would or could have different descriptions than the schema they are referring to, because they represent something else.Is there any other way of doing this, or does someone have an explanation as to why this is a feature of the spec?
Beta Was this translation helpful? Give feedback.
All reactions