Skip to content

Commit 3283f37

Browse files
committed
Add a global parameters field
This just adds the field without any special handling. It is already possible with the Path Item Object's parameters field to specify parameters that don't make sense for all of the operations, and we don't attempt to compensate for it. The only truly new situation is that there is no one path to which path parameters would correspond. I suspect that global path parameters will be rare, and mostly used in a prefix as more powerful analogues of Server Variables.
1 parent 51aaf58 commit 3283f37

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

src/oas.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ In addition to the required fields, at least one of the `components`, `paths`, o
103103
| <a name="oas-webhooks"></a>webhooks | Map[`string`, [Path Item Object](#path-item-object)] | The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the `callbacks` feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An [example](https://learn.openapis.org/examples/v3.1/webhook-example.html) is available. |
104104
| <a name="oas-components"></a>components | [Components Object](#components-object) | An element to hold various Objects for the OpenAPI Description. |
105105
| <a name="oas-security"></a>security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. Individual operations can override this definition. The list can be incomplete, up to being empty or absent. To make security explicitly optional, an empty security requirement (`{}`) can be included in the array. |
106+
| <a name="path-item-parameters"></a>parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for all operations in this API. These parameters can be overridden at the path item or operation levels, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameter-name) and [location](#parameter-in). The list can use the [Reference Object](#reference-object) to link to parameters that are defined in the [OpenAPI Object's `components.parameters`](#components-parameters). |
106107
| <a name="oas-tags"></a>tags | [[Tag Object](#tag-object)] | A list of tags used by the OpenAPI Description with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operation-object) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique. |
107108
| <a name="oas-external-docs"></a>externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation. |
108109

src/schemas/validation/schema.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ properties:
3737
type: array
3838
items:
3939
$ref: '#/$defs/security-requirement'
40+
parameters:
41+
$ref: '#/$defs/parameters'
4042
tags:
4143
type: array
4244
items:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
openapi: 3.3.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
parameters:
6+
- name: limit
7+
in: query
8+
schema:
9+
type: integer
10+
minimum: 0
11+
paths:
12+
/things:
13+
summary: Lots of things
14+
get:
15+
summary: Get a list of things
16+
responses:
17+
default:
18+
description: A list of things

0 commit comments

Comments
 (0)