swagger-api / swagger-api/swagger-ui

Error on Swagger PetStore 2.0 example when optional formData field is empty

Open
#8,926 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

  1. Open https://editor.swagger.io/
  2. Click Edit > Choose Load Petstore OAS 2.0
  3. On the right panel, try out POST /pet (Change first property id: from 0 to 100 , leave other fields as is) hit enter
  4. Go to post /pet/{petId}/uploadImage Try it out, set petId to 100, leave other formData fields empty. Hit enter
  5. See response: "message": "org.jvnet.mimepull.MIMEParsingException: Missing start boundary"
  6. 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.