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

Allow required as sibling of $ref (like summary/description) #2498

Open
radicarl opened this issue Mar 10, 2021 · 5 comments
Open

Allow required as sibling of $ref (like summary/description) #2498

radicarl opened this issue Mar 10, 2021 · 5 comments
Labels
param serialization Issues related to parameter and/or header serialization re-use: traits/merges Selective or modified re-use

Comments

@radicarl
Copy link

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
@MikeRalphson
Copy link
Member

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.

@PixnBits
Copy link

maybe similar to #2089, PR to v3.1 in #2181

@JameelKhan9
Copy link

similar to #2026

@handrews
Copy link
Member

handrews commented Nov 7, 2022

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.

@handrews handrews added re-use re-use: traits/merges Selective or modified re-use and removed $ref labels Jan 29, 2024
@handrews handrews added the param serialization Issues related to parameter and/or header serialization label May 24, 2024
@handrews
Copy link
Member

If we implement #1502 in 3.2, we won't need to do anything for this because when using the Encoding Object approach to form-urlencoded, all fields are one schema, and JSON Schema 2020-12 already allows putting any keyword next to $ref (which acts like an allOf, not a merge or overwrite).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
param serialization Issues related to parameter and/or header serialization re-use: traits/merges Selective or modified re-use
Projects
None yet
Development

No branches or pull requests

5 participants