OAI / OAI/OpenAPI-Specification

Supporting of one separate 'required' option for query parameters

Open
#2,347 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

param serialization re-use: globals/defaults re-use: traits/merges
Dominant language
Markdown
Stars
31.2k
Forks
9.2k
Avg merge
6h 37m
Merged PRs (30d)
27

Description

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'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the issue's proposed YAML and the OpenAPI rules for reusable Parameter Objects, operation parameters, and the required property. No repository files or tests are named, so first locate the specification sections and related discussions. Done would require an agreed model for separate requiredness and corresponding specification or validation updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.