swagger-api / swagger-api/swagger-codegen
Allow more control over building request URL for javascript client
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Same as #5627 but for javascript (web). I need to prevent the JS library from calling encodeURIComponent on the path because forward slash characters need to be passed through correctly.
Swagger-codegen version
Latest - from editor.swagger.io/#/
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Generate a library that takes a parameter. Set the value of the parameter to something with a slash, e.g. users/3. It shouldn't be URL encoded to users%2F3.
Related issues/PRs
#5627
Suggest a fix/enhancement
Either update the library to accept a list of whitelisted characters not to URL encode, or a flag to disable URL encoding.
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 with modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache, especially the linked URL-building call using encodeURIComponent. Reproduce the generated client with a path parameter such as users/3, then determine how the requested whitelist or opt-out should be exposed. Done means the generated JavaScript client preserves the slash as requested without breaking normal URL encoding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100