The OpenAPI validation for "multipart/form-data" is not working properly.
まだ誰も着手していません。
評価
調査の方向性
The issue is in RequestValidatorImpl where the body for multipart/form-data is null. Start by examining the validation flow for multipart requests in vertx-openapi. Look at the test suite for OpenAPI validation to understand how multipart/form-data is handled. The fix likely involves ensuring the body is properly extracted and passed to the validator. Check the linked image for the exact line (148) in RequestValidatorImpl.
索引モデルが issue の本文から書いたものです。
説明
Version
5.2.0
Context
I have an OpenAPI description for an endpoint with content “multipart/form-data”:
paths:
/someEndpoint:
post:
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required:
- someFile
- someValue
properties:
someFile:
type: string
format: binary
someValue:
type: string
encoding:
someFile:
contentType: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
In Vertx 4, this worked correctly, and I received validation errors for required fields:
for example (if missed) BodyProcessorException - "[Bad Request] Validation error for body multipart/form-data: provided object should contain property someValue"
After migrating to Vertx 5, it was broken, and I got the ValidatorException: "The related request does not contain the required body."
io.vertx.openapi.validation.impl.RequestValidatorImpl:
The body in the request for multipart/form-data is always null, and we got an exception for the required body on 148 line.
Or if the body is not required, then all other validation for form fields will be skipped.
Steps to reproduce
No response
Do you have a reproducer?
No response
- 主要言語
- Java
- スター
- 15
- フォーク
- 19
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-vertx/vertx-openapi のほかの issue
-
enhancement help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
eclipse-vertx/vertx-openapi#136 · コメント 1 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
eclipse-vertx/vertx-openapi#122 · コメント 4 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
eclipse-vertx/vertx-openapi#117 · コメント 6 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
eclipse-vertx/vertx-openapi#93 · コメント 1 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
eclipse-vertx/vertx-openapi#92 · コメント 4 件 ·
eclipse-vertx/vertx-openapi の issue をすべて見る
似ている issue
-
Component: Frontend Component: Web Component Type: Maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
it-at-m/refarch-templates#1944 ·
メンテナーはふだん 2 日以内に返信
-
priority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
googleapis/java-genai#1372 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
-
GeoSeries scale and skew tests fail with pytest 9.2.0対応中かも @jiayuasu が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
priority: medium Review effort [1-5]: 3 status: needs-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
carlos-emr/carlos#5431 ·
メンテナーはふだん 1 日以内に返信