-
|
It feels very strange for me that Parameter Object ( Isn't it a good idea to add |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
JSON Schema 2020-12 used in OAS 3.1 has it's own mechanism of making references: https://json-schema.org/draft/2020-12/json-schema-core.html#ref. Which means Schema Object itself can act as a reference if defined in following way: { "$ref": "#/pointer" } |
Beta Was this translation helpful? Give feedback.
-
As already mentioned, Schema Object has it's own referencing mechanism and semantics on Schema Objects with
Maybe please refer to this issue asyncapi/spec#552 in AsyncAPI spec, when they currently have only |
Beta Was this translation helpful? Give feedback.
-
|
@flaksp your example application/json:
schema:
$ref: "#/components/schemas/Pet"
description: "Description goes here"
summary: "Summary goes here"is perfectly valid in OAS 3.1.0. Schemas support $ref siblings as part of JSON Schema 2019-09 and later. (OAS 3.1 uses JSON Schema 2020-12 by default.) Schema $refs are a bit different from OpenAPI Reference Objects (used for parameter $refs, response $refs, etc.) in that schema $refs support any sibling keywords, whereas OAS Reference Objects only support sibling Note that JSON Schema doesn't have the |
Beta Was this translation helpful? Give feedback.
-
|
Closing as answered (in 2021) |
Beta Was this translation helpful? Give feedback.
@flaksp your example
is perfectly valid in OAS 3.1.0.
Schemas support $ref siblings as part of JSON Schema 2019-09 and later. (OAS 3.1 uses JSON Schema 2020-12 by default.) Schema $refs are a bit different from OpenAPI Reference Objects (used for parameter $refs, response $refs, etc.) in that schema $refs support any sibling keywords, whereas OAS Reference Objects only support sibling
summaryanddescription.Note that JSON Schema doesn't have the
summarykeyword so it will be handled as an annotation.