Are these OpenAPI 3 paths ambiguous?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- openapi
- 領域
- api, documentation
調査の方向性
versions/3.0.0.md の Paths Object セクションを読み、この issue の /shops/{shopId}/pets/{petId} および /shops/{shopId}/pets/_search の例と、そのマッチングルールを比較してください。テキストに定義または追加の例が必要かどうかを判断する前に、既存の議論を確認してください。maintainers が明確化された仕様の文言に合意し、該当するセクションが更新されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
As suggested by @MikeRalphson on Stackoverflow, I'm asking the question here as well.
Are those OpenAPI 3 paths ambiguous?
/shops/{shopId}/pets/{petId}
/shops/{shopId}/pets/_search
I want to answer no but, strictly reading the spec, I can't decide because they seem to fall into none of the 3 statements made by the spec:
- Neither path is concrete (term used in the spec)
- Paths don't seem to meet the Templated paths with the same hierarchy but different templated names criteria (that is not very clear to me, here is my understanding:
"/shops/{}/pets/{}" != "/shops/{}/pets/_search") - Paths do not look like the ambiguous example
In addition to the question asked on Stackoverflow, let me ask two additional questions (below).
Should the OA3 spec be improved?
@MikeRalphson's reading of the spec: path are not ambiguous because one is more concrete than the other.
If paths are indeed not ambiguous, then the more concrete notion might need to be defined.
How could the OA3 spec be improved?
We might add an example like this:
Assuming paths sharing a common and identical prefix,
/shops/{shopId}/pets, the more concrete definition,/shops/{shopId}/pets/_search, will be matched first if used:/shops/{shopId}/pets/{petId} /shops/{shopId}/pets/_search
Or we might only show minimalistic examples involving templated names, and say that they also apply in case of common and identical prefixes:
First statement (concrete vs template case):
/{otherPlace} /here
Second statement (considered identical and invalid):
/{id} /{name}
Third statement is left unchanged (ambiguous resolution):
/{entity}/me /books/{id}
Related excerpt of the OA3 spec
The "Paths object" paragraph of the OpenAPI 3 specification (https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#paths-object) is stating (3 sentences, 3 statements):
When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
Those 3 statements are followed by 3 examples (and that's it):
Assuming the following paths, the concrete definition,
/pets/mine, will be matched first if used:/pets/{petId} /pets/mineThe following paths are considered identical and invalid:
/pets/{petId} /pets/{name}The following may lead to ambiguous resolution:
/{entity}/me /books/{id}
- 主要言語
- 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 が 32 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
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
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
huggingface/smolagents#2976 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
FuRongJun-1999/dsh-memory#170 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
testcontainers/testcontainers-node#1539 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
backdrop-contrib/commerce#60 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100