-
Which specification is responsible for describing the processing of
If you believe that "$ref": "#/components/schemas/Address" Note that I can see how I can make such a reference work. The question is which rules mandate and guarantee the behavior assumed/intended by the author of this example (and many similar examples). If an implementation did not support this behavior, which rules would it break? How would we argue in a hypothetical court case where good will and common sense are weak arguments? If you believe that items:
type: object
$ref: '#/components/schemas/Address' |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
There are no violations of JSON Schema in these examples.
I can't understand what problem do you see in spec examples. Are you talking about the
It's valid. |
Beta Was this translation helpful? Give feedback.
-
(This answer is specifically about OAS 3.1. Earlier versions are slightly different in this regard.) There are two types of $refs:
|
Beta Was this translation helpful? Give feedback.
-
I've marked the correct answer to the original question. The rest of the discussion is more about JSON Schema than OpenAPI, so I'm going to close this as resolved (as far as OpenAPI is concerned). |
Beta Was this translation helpful? Give feedback.
(This answer is specifically about OAS 3.1. Earlier versions are slightly different in this regard.)
There are two types of $refs:
Within schemas (aka Schema Objects), the $refs are processed according to the JSON Schema rules. For example, given a schema definition based JSON Schema 2020-12 (the default version used by OAS 3.1), this is the relevant section of the JSON Schema spec.
Everywhere else (e.g. $refs to parameter/response/requestBody definitions) the $refs are the so-called "Reference Objects" and are processed …