Incorrect / misleading error information provided when validating request body
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- node.js, openapi, typescript
調査の方向性
Start with the linked example repository: run npm ci and npm run test as described, then inspect api.test.ts and its failing validation cases. Trace how the project validates request bodies against shared Datum schemas and constructs instancePath, schemaPath, and the errors array. Done means failures identify the correct fields and multiple invalid fields produce separate errors.
索引モデルが issue の本文から書いたものです。
説明
Version: 5.10.6
Scenario:
- The OpenAPI spec denotes a
requestBodywith multiple composite "datum" fields that have a commonDatumschema also defined in the OpenAPI spec (there are three of these in my example). - The
Datumschema has fieldsvalue(of typenumber) andunit(of type enum defined in the OpenAPI spec). - The example repo for this is here: https://github.com/markgreenwood/openapi-backend-validation-bug
Expected behavior:
- A composite field that fails to validate should report an error with
instancePathandschemaPaththat both reflect that field's identity (i.e. contain the name of the invalid field). - If multiple fields fail validation, there should be multiple errors that each contain the information described above.
Actual behavior:
- If any fields using the
Datumschema OTHER than the first one in the spec are provided non-numeric values, the error'sschemaPathreports validation failure with the name of the FIRST field listed that uses theDatumschema, not the one that actually failed validation. (In the example, ifweightis provided a non-numeric value, theschemaPathincorrectly reportsdistanceas the culprit that failed validation.) - If multiple fields fail validation, the errors array only contains one error, not all the ones that failed to validate. (In one of the example tests, both
weightandtemperatureare provided non-numeric values, but only one error is reported and itsschemaPathincorrectly reportsdistanceas being invalid.)
Steps to reproduce:
- Clone or fork the example repo, install dependencies with
npm ci, and then runapi.test.tsusingnpm run test. Two of the tests describing the expected behavior above should fail.
- 主要言語
- TypeScript
- スター
- 689
- フォーク
- 97
- 平均マージ
- 2時間 36分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openapistack/openapi-backend のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
openapistack/openapi-backend#1046 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
openapistack/openapi-backend#1047 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 44/100
openapistack/openapi-backend#860 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
openapistack/openapi-backend#814 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
openapistack/openapi-backend#809 ·
メンテナーはふだん 1 日以内に返信
openapistack/openapi-backend の issue をすべて見る
似ている issue
-
Recording drops clicks on links, filters and checkboxes that share a form with a search field対応中かも @columbia11 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Tencent/BrowserSkill#657 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 2 日以内に返信
-
Choosing a folder while continuing an Antigravity session submits a history fork the runtime rejectsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
-
ai-handle
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nextlevelbuilder/dewee-web-v2#138 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NEARBuilders/citynode.app#512 ·
メンテナーはふだん 1 日以内に返信