swagger-api / swagger-api/swagger-ui
JSON parameters passed via query string are interpreted as strings
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Version:
3.0.17
Swagger file:
any file will reproduce this issue
Expected:
Passing "true" or "false" as query strings are parsed as booleans into boolean configuration fields.
Result:
"true" or "false" query strings are interpreted as strings, resulting in the following error (in dev):
warning.js:36 Warning: Failed prop type: Invalid prop `displayOperationId` of type `string` supplied to `Operation`, expected `boolean`.
in Operation (created by Operations)
in Operations (created by _class)
in _class (created by Connect(_class))
in Connect(_class) (created by BaseLayout)
in section (created by Col)
in Col (created by BaseLayout)
in div (created by Row)
in Row (created by BaseLayout)
in div (created by BaseLayout)
in div (created by BaseLayout)
in BaseLayout (created by _class)
in _class (created by Connect(_class))
in Connect(_class)
in section (created by Container)
in Container
in StandaloneLayout (created by _class)
in _class (created by Connect(_class))
in Connect(_class) (created by App)
in App (created by _class)
in _class (created by Connect(_class))
in Connect(_class) (created by _class2)
in Provider (created by _class2)
in _class2
URL used to create error: http://localhost:3200/?displayOperationId=true
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 with the provided URL, ?displayOperationId=true, using Swagger UI 3.0.17, then trace how query-string configuration values are parsed and passed to the UI. Done means boolean query values such as true and false reach configuration fields as booleans rather than strings, without the reported prop-type warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100