Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework encodeDisallowedCharacters function for OpenAPI 3.x request builders #3462

Closed
glowcloud opened this issue Apr 8, 2024 · 1 comment

Comments

@glowcloud
Copy link
Contributor

encodeDisallowedCharacters function

export function encodeDisallowedCharacters(str, { escape } = {}, parse) {

contains logic that should be moved out of it - the function should only encode characters.
We can move the logic for converting numbers to strings and returning empty strings or non-string type values to the valueEncoder function. It should take care of converting all values to strings as it does now for objects and arrays.
export function valueEncoder(value, escape) {

We can also remove the parse parameter as it is not used anywhere.

The signature of the function should be encodeCharacters(str, { characterSet = 'reserved' } = {} and the logic for returning non-encoded strings for when the escape value is set to false should also be moved to valueEncoder.

@char0n
Copy link
Member

char0n commented Apr 8, 2024

Addressed in #3463

@char0n char0n closed this as completed Apr 8, 2024
swagger-bot pushed a commit that referenced this issue Apr 8, 2024
## [3.26.7](v3.26.6...v3.26.7) (2024-04-08)

### Bug Fixes

* **execute:** refactor URL character encoding mechanism function ([#3463](#3463)) ([d2c1bba](d2c1bba)), closes [#3462](#3462)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants