Skip to content

Request bodies with content types such as application/zip do not have a file upload input #5636

Closed
@danielflower

Description

@danielflower

Q&A (please complete the following information)

  • Swagger-UI version: 3.23.11
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

"requestBody": {
          "content": {
            "application/zip": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }

Describe the bug you're encountering

When a request body has application/zip as the content type, the input box on swagger-ui is a textbox with "string" as the default value. It should be a file input box.

Additional context or thoughts

Changing the content type to application/octet-stream results in a file upload box, but I'd rather have the more specific content type in my openapi description. I think it would be better to look at the schema's type and format rather than the mime type to decide whether or not to use a file upload.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions