The Response object's `default` field is confusing and inconsistently interpreted
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 28/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- openapi
- 領域
- api, documentation
調査の方向性
まず examples/v3.0/petstore-expanded.yaml と、OpenAPI 3.0 および 3.1 の Response オブジェクトの定義を確認します。default の文書化された意味と、例で意図されているエラー処理を比較し、どの明確化または例の更新が実現可能かを特定します。完了には、仕様または例に対する合意済みの変更が必要になります。
索引モデルが issue の本文から書いたものです。
説明
According both 3.0 and 3.1, in theResponse object there MUST be at least one response code and it SHOULD be the response for a successful operation call. In addition the default describes “responses other than the ones declared for specific HTTP response codes”.
This means that if we had a 200 response and default, the latter would cover everything except for 200. Many seem to interpret default to mean something like response categories not covered by explicit response codes. Consider this example from the OAI org:
responses:
'200':
description: pet response
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore-expanded.yaml
This implies that default covers error types when in fact it covers non-error responses as well. In fact, the consumer wouldn't necessarily know if the API might reply with another success code such as a 204. A more precise example might look like this:
responses:
'200':
description: pet response
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
4xx:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
5xx:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
I would suggest the following actions:
- Update the example to interpret the spec more literally
- Clarify
defaultsince this confusion is not limited to this example, but extends to APIs in the wild - Consider in 3.2 or 4.0 eliminating
default - Consider in 3.2 or 4.0 adding a new named
errorcategory that means "both 4xx and 5xx". This could be used in the way thatdefaultis often misused today
- 主要言語
- 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
-
layer.setProps: opacity above 1 is clamped silently (layerStyle uses 0..100)対応中かも @switch87 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
storytold/photocraft#5242 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
pinterest/pymemcache#662 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
[Enhancement]: Add Cheaper Inference to known custom endpoint providers対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン✨ enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
LibreChat-AI/LibreChat#17075 ·
メンテナーはふだん 1 日以内に返信