swagger-api / swagger-api/swagger-parser

Parsing multipart/form-data body

Open
#2,135 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
867
Forks
560
Avg merge
2d 21h
Merged PRs (30d)
7

Description

Hi,

I'm using swagger-parser 2.1.23 to parse an openapi 3.1.0 yaml file.

I have a request with multipart/form-data body to upload a file:

image

requestBody schema is parsed as JsonSchema:

image

Request body is rendered as JSON in swagger UI:

image

What can I do to get a "upload button" displayed in here.

Thank you in advance

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with swagger-parser 2.1.23 using the provided OpenAPI 3.1.0 YAML and inspect the requestBody schema for multipart/form-data. Compare the parsed JsonSchema with the file-upload definition; done means the multipart request is preserved well enough for Swagger UI to display an upload button.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.