swagger-api / swagger-api/swagger-ui
ID conflict in between "Send empty value" checkboxes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: Linux Debian 13
- Browser: firefox
- Version: Zen 1.19.8b (Firefox 149.0.2)
- Method of installation: npm
- Swagger-UI version: 5.32.6
- Swagger/OpenAPI version: OpenAPI 3.1
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.1.0
paths:
/hello:
post:
requestBody:
content:
application/x-www-form-urlencoded:
schema:
properties:
foo:
type: string
bar:
type: string
default: ""
baz:
type: string
default: ""
type: object
required:
- foo
required: true
Swagger-UI configuration options: defaults.
Describe the bug you're encountering
An ID conflict between the checkboxes is causing all their labels to only control one. (see screenshot)
To reproduce...
Steps to reproduce the behavior:
- Load the OpenAPI definition above
- Expand the
/helloendpoint - Click 'Try it out'
- Click on one of the 'Send empty value' labels
- Click on the other label
- See that the same checkbox was toggled
Expected behavior
Each label controls the checkbox it is located next to.
Screenshots
Additional context or thoughts
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
Start by loading the supplied OpenAPI 3.1 definition in Swagger UI and reproducing the two “Send empty value” controls in the form. Search the frontend implementation for that control and inspect how each checkbox and label receives its ID; done means each label toggles only its adjacent checkbox.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100