The OpenAPI validation for "multipart/form-data" is not working properly.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Java
- Star
- 15
- Fork
- 19
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eclipse-vertx/vertx-openapi
-
Add OpenAPI 3.2 supportĐang mởenhancement help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
eclipse-vertx/vertx-openapi#136 · 1 bình luận ·
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
eclipse-vertx/vertx-openapi#122 · 4 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
eclipse-vertx/vertx-openapi#117 · 6 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
eclipse-vertx/vertx-openapi#93 · 1 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
eclipse-vertx/vertx-openapi#92 · 4 bình luận ·
Tất cả issue của eclipse-vertx/vertx-openapi
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
oracle/graalvm-reachability-metadata#11472 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 89/100
objectionary/hone-maven-plugin#1353 ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Update samples to Citrus 5.1.0Có thể đã có người làm @asuruceanu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/doris#69863 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày