v3.3: Global parameters
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- openapi
- 領域
- api, documentation
調査の方向性
まずディスカッション #5314 を読み、その後、この issue で説明されている OpenAPI 3.3 のパラメーター規則を確認してください。完了条件は、グローバルな parameters フィールドを追加するかどうかを決定し、path、querystring、header、query、cookie パラメーターについて選択した動作を記録することです。
索引モデルが issue の本文から書いたものです。
説明
I'm breaking this out from discussion #5314 which covers allowing various fields at multiple levels.
This issue is to consider the implementation challenges of a global (OpenAPI Object in the entry document) parameters field, and ultiimately decide whether to add such a field.
TL;DR:
in: path— keep the existing mandatoryrequired: trueand make it an error any time anin: pathparameter does not match a path template variable; this limits the utility of globalin: pathparameters, but that's finein: querystring— this can only be used once per operation, so setting it globally is unlikely to be useful, but we needn't forbid it; this is probably rarely used even at the Path Item level for the same reasonin: header— it's already possible to specify headers at the Path Item level that don't make sense for every operation, so it doesn't matter if it's also possible at the global level; we don't worry about it now, and we don't need to start worrying about it
I can't think of any concerns with in: query or in: cookie parameters that don't already exist with the Path Item plus Operation levels.
More details and options below for those interested:
global in: path parameters
Use case: Every item path template looks like /foo/{id}, so there is a desire to specify the id path parameter globally.
Problem: Not every path template is an item template, and in: path parameters MUST state required: true
- If other path templates have an
idpath parameter with different syntax or semantics, then defining one globally is just a user error, and we need not concern ourselves with it. - If (as is likely), some path templates don't have an
idpath parameter at all, what happens?- If it is an error (retaining the
required: truerequirement), we are making a useful use case impossible. - If we allow
required: falseon path parameters, we could say that that means that it can be ignored if there is no matching path template variable; however this behavior is more complex and no longer just adding another level
- If it is an error (retaining the
My thought is that for 3.3, we retain required: true, so ending up with an in: path parameter that does not match a path template variable is always an error. This is the simplest option, and we can add more functionality in a future release if there is strong enough demand.
global in: querystring parameters
Since you can't have two of these on the same operation, regardless of where they were defined, nor can you combine them with any in: query parameters, this will probably not be used globally. And probably isn't often used at the Path Item level.
This restriction mostly exists to keep request matching complexity to a manageable level. Note that there is a weird exception in that an API Key query parameter presumably gets tacked on regardless, as we don't address it. We should probably clarify that.
My thought for 3.3 is to not do anything special about this. No one has complained about it AFAIK, so let's keep going. API Keys are a SAF and by definition cause exceptions to normal rules, so it being an exception already is fine.
global in: header parameters
Similarly, some request headers are broadly but not universally useful. However, unlike path template variables, there is no required: true requirement.
Specifying an irrelevant header parameter is possible now, and we don't worry about it. For example:
/foos:
parameters:
- in: header
name: Prefer
schema:
type: string
pattern: ^return=(minimal|representation)
get: {...}
post: {...}
Applying this preference to the GET request doesn't really make sense, as GET by definition returns the representation. A return=minimal GET request would effectively be a HEAD request.
And for that matter, as written above, the Prefer header parameter would apply to a HEAD operation (even though none is explicitly described), which also doesn't make any sense.
My thought for 3.3 is that we don't worry about this now, and I suggest we continue to not worry about it. It might not make sense, but irrelevant HTTP fields are generally silently ignored, so even if someone sent this field (and note that it is not required), it is unlikely it would cause a problem.
- 主要言語
- Markdown
- スター
- 31.2k
- フォーク
- 9.2k
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 17
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OAI/OpenAPI-Specification のほかの issue
-
Housekeeping
難易度 1/5 1時間未満 初心者へのやさしさ 45/100
OAI/OpenAPI-Specification#5566 ·
メンテナーはふだん 1 日以内に返信
-
Housekeeping
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
OAI/OpenAPI-Specification#5562 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Housekeeping
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
OAI/OpenAPI-Specification#5556 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
v3.2.1 release再び着手できるかも @lornajane が 33 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
OAI/OpenAPI-Specification#5460 · コメント 11 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
param serialization
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
OAI/OpenAPI-Specification#5366 · コメント 12 件 ·
メンテナーはふだん 1 日以内に返信
OAI/OpenAPI-Specification の issue をすべて見る
似ている issue
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunk対応中かも @rodricksz4h5 が今日担当しました。 オープンarea/streaming comp/gateway P2 type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#138245 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
Luligu/matterbridge#655 ·
-
enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
graygarbage/HermesKey#23 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
we-promise/sure#4199 ·
メンテナーはふだん 1 日以内に返信