swagger-api / swagger-api/swagger-ui
Error on Swagger PetStore 2.0 example when optional formData field is empty
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
- Open https://editor.swagger.io/
- Click Edit > Choose Load Petstore OAS 2.0
- On the right panel, try out POST /pet (Change first property id: from 0 to 100 , leave other fields as is) hit enter
- Go to post /pet/{petId}/uploadImage Try it out, set petId to 100, leave other formData fields empty. Hit enter
- See response: "message": "org.jvnet.mimepull.MIMEParsingException: Missing start boundary"
- On left side code panel, ctrl + F “/pet/{petId}/uploadImage:” the formData fields are both required: false.
This error is affecting me on other important uses of Swagger. Would appreciate if this can be resolved soon as possible.
Seems we get errors when formData file fields with 'required: false', when using swagger and not supplying the file (tho it is not required).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue at editor.swagger.io with the Load Petstore OAS 2.0 example, then inspect the generated request for POST /pet/{petId}/uploadImage when both optional formData fields are empty. Done means the request no longer returns a MIMEParsingException about a missing start boundary for omitted optional file fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, openapi
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100