Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

The OpenAPI validation for "multipart/form-data" is not working properly.

Đang mở
#137 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
api

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ả

bug
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:
Image
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-vertx/vertx-openapi

Tất cả issue của eclipse-vertx/vertx-openapi

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.