Skip to content

Supporting of one separate 'required' option for query parameters #2347

Open

Description

@Morgunov-Vitaly

Hi!
For example, there are several paths that include similar parameters, but with different required options: in some paths parameters are required, in others they are optional.

If we can specify the required option separately, we can reuse parameter descriptions. Like this:

/api/v1/rootname:
    get:
      summary: 'Path example'
      parameters:
        - $ref: '#/components/parameters/queryFiltersDateFrom'
        - $ref: '#/components/parameters/queryFiltersDateTo'
        - $ref: '#/components/parameters/queryGroups'
        - $ref: '#/components/parameters/queryOrderByColumn'
        - $ref: '#/components/parameters/queryOrderByDirection'
      required:
        - 'filters[date_from]'
        - 'filters[date_to]'
        - 'groups'
        - 'order_by_column'
        - 'order_by_direction'

Activity

  1. hkosova commented on Oct 10, 2020

    @hkosova
    Contributor

    Related (or duplicate): #2026

  2. added
    param serializationIssues related to parameter and/or header serialization
    re-use: globals/defaultsDefault or global components that can be overridden in some way
    and removed on Jan 28, 2024
  3. added this to the v3.2.0 milestone on May 16, 2025
  4. modified the milestones: v3.2.0, v3.3.0 on Jul 31, 2025
  5. handrews commented on Jul 31, 2025

    @handrews
    Member

    This is supported for query parameters in 3.2 through PR #4590 by modeling all query parameters in a single schema, which lets you use the regular required for this. We will consider further work in future releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    param serializationIssues related to parameter and/or header serializationre-use: globals/defaultsDefault or global components that can be overridden in some wayre-use: traits/mergesSelective or modified re-use

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions