How to display complex objects in multipart/form-data requests in Swagger UI?

Viewed 381

I am using OpenAPI 3.0.1 and I am trying to send a request as multipart/form-data. The request body is defined as follows:

       requestBody:
         content:
           multipart/form-data: # Media type
             schema:            # Request payload
               type: object
               properties:      # Request parts
                 media:            # Part 1 (string value)
                   type: string
                 address:       # Part2 (object)
                   type: object
                   properties:
                     street:
                       type: string
                     city:
                       type: string
                 profileImage:  # Part 3 (an image)
                   type: string
                   format: binary

Here, the address field is an object. Swagger UI shows the address field itself, but does not show its properties street, city. Why is that?

Multipart form fields in Swagger UI

1 Answers

This issue was fixed in Swagger UI v. 3.51.0. Make sure you're using the latest version.

Related