Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Specify additional known responses other than 200 OK in swagger schema

オープン
#85 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
openapi
領域
api, documentation

調査の方向性

まず、現在 200 レスポンスのみを記述している操作の Swagger/OpenAPI スキーマ定義を見つけます。401 と 422 を含む、文書化された共通エラーレスポンスを確認し、生成されたクライアントが各操作の既知のレスポンスを確認できることを検証します。スキーマが成功レスポンスと、それらの操作に関連する既知のエラーを記述していれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Tripletex's schema describes 200 OK responses, like this:

image

but it is lacking in regards to describing the other expected responses like 401, 422 etc. This results in generated clients[^2] not knowing of all responses an operation may yield, in this case it has no knowledge of any errors:

image

If I understand swagger's doc^1 correctly it would be appropriate to include other common responses too:

Note that an API specification does not necessarily need to cover all possible HTTP response codes, since they may not be known in advance. However, it is expected to cover successful responses and any known errors. By "known errors" we mean, for example, a 404 Not Found response for an operation that returns a resource by ID, or a 400 Bad Request response in case of invalid operation parameters.

[^2]: Example https://openapi-ts.pages.dev/

主要言語
言語のデータがありません
スター
49
フォーク
47
平均マージ
31分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Tripletex/tripletex-api2 のほかの issue

Tripletex/tripletex-api2 の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。