swagger-api / swagger-api/swagger-ui
OpenAPI 3.x: request body doesn't update when changing between content type in try it out
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Describe the bug you're encountering
Request body value in try it out isn't being updated when switching to a different content type, if the value was edited.
To reproduce...
Steps to reproduce the behavior:
- Go to https://petstore3.swagger.io/
- Click on
/petPUT request - Click on try it out button
- Edit the value
- Switch to
application/xmlcontent type - See that the value didn't update
The same thing will happen if we edit application/xml first and then switch to application/json.
Expected behavior
The value should switch to the default value for the current content type.
Screenshots
When switching from application/json to application/xml:
When switching from application/xml to application/json:
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 in the Swagger Petstore at the /pet PUT operation: enter Try It Out, edit the request body, and switch between application/json and application/xml. Trace the request-body handling for content-type changes; done means each switch displays the default value for the selected content type, in both directions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, openapi
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100