OpenAPI-Specification
OpenAPI-Specification copied to clipboard
Allow required as sibling of $ref (like summary/description)
Hello,
it would be great for reusability if I could overwrite the required
field of parameter and header objects, like I can overwritesummary
and description
in OpenAPI 3.1.
paths:
/my-resource:
parameters:
- $ref: '#/components/parameters/Accept'
required: true
get:
# some definition
components:
parameters:
Accept:
name: Accept
in: header
required: false
schema:
type: string
Thanks for this. We deliberately started small with the scope of this feature with the hope of collecting more data points about what properties people would find it useful to override. In this example we would currently have to say you could not override required: true
of an in: path
parameter with a false
value, but otherwise, I can see how this would be useful.
maybe similar to #2089, PR to v3.1 in #2181
similar to #2026
Folks interested in this topic will likely be interested in the general referencing discussion that has recently started. Keywords adjacent to $ref
outside of JSON Schema make for a very tricky topic.