swagger-api / swagger-api/swagger-ui
Only default x-example values used in curl call
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: Win
- Browser: Mozilla, Chrome
- Version: Mozilla: 71.0, Chrome: 78.0
- Method of installation: yarn
- Swagger-UI version: swagger-ui/swagger-ui-react: ^3.24.3
- Swagger/OpenAPI version: Swagger 2.0
Content & configuration
Example Swagger/OpenAPI definition:
Json swagger as several parameters with a x-example property set, which is used as the default values in the curl call, which is the main issue here
"parameters": {
"requestId": {
...
"x-example": "123ABC"
},
Swagger-UI configuration options:
return <SwaggerUI spec={swaggerJson} />
Describe the bug you're encountering
When I try out our get paths with manually entered parameter values, it will still use the default "x-example"-values defined in the swagger doc.
To reproduce...
Steps to reproduce the behavior:
- Go to any get path
- Click on Try it out
- Scroll down to parameters, remove default values, fill in your own values
- Click Execute
- Curl will make the call, but will use the default x-example values for the query string parameters
Expected behavior
Expect the entered values to be the ones that curl will use as parameters
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 through the SwaggerUI spec configuration: open a GET path, use Try it out, replace or remove the x-example values, and execute the request. Trace the request-generation entry point used by curl and verify that the submitted parameter values, rather than the documented defaults, are used; done means the generated curl command and call contain the entered values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100