swagger-api / swagger-api/swagger-client
parameter builder uses a comma instead of an empty string
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 765
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 6
Description
Hello,
it seems that an additional , can appended to the path in some cases and it has been detected using swagger ui's execution feature (swagger-ui-dist@3.32.5). It could be traced back to the following line:
The default behavior of Array.join will be used if styledValue is undefined.
The following yaml definition creates this case, if the input field in swagger ui remains untouched
paths:
/openapi/specification{plural}:
parameters:
- name: plural
in: path
required: false
schema:
type: string
pattern: "s?
Many thanks in advance.
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 in src/execute/oas3/parameter-builders.js at the linked parameter-builder line and trace how the path parameter value is assembled when styledValue is undefined. Reproduce the YAML case with an untouched Swagger UI input, then verify that the generated path uses an empty value rather than an additional comma.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100