The OpenAPI validation for "multipart/form-data" is not working properly.
还没有人认领这个 Issue。
评估
调研方向
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 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 一周以上 新手友好度 35/100
eclipse-vertx/vertx-openapi#93 · 1 条评论 ·
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
eclipse-vertx/vertx-openapi#92 · 4 条评论 ·
查看 eclipse-vertx/vertx-openapi 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 80/100
OpenAPITools/openapi-generator#25454 ·
维护者通常 1 天内回复
-
Component - Build
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
-
bug
难度 2/5 1-3 小时 新手友好度 77/100
navikt/mock-oauth2-server#1149 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
oracle/graalvm-reachability-metadata#11318 ·
维护者通常 1 天内回复