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

Add type casting for Swagger UI configuration options #9808

Closed
glowcloud opened this issue Apr 11, 2024 · 3 comments
Closed

Add type casting for Swagger UI configuration options #9808

glowcloud opened this issue Apr 11, 2024 · 3 comments

Comments

@glowcloud
Copy link
Contributor

glowcloud commented Apr 11, 2024

When the configuration options are defined in the URL query parameters, we are actually getting strings. This causes issues if the value of the configuration parameter should not be a string.

For example, for deepLinking we should actually have a boolean value, but instead we'll have a string "true". This means that this configuration option won't actually be activated.

To fix this, we need to cast values into proper types if we can, ex. for number and boolean. We won't be parsing object and array type values.

@glowcloud glowcloud self-assigned this Apr 12, 2024
@char0n
Copy link
Member

char0n commented Apr 16, 2024

Le'ts concentrate the type casting int config/type-cast module. We will map path to the typecaster to make the design declarative.

const Boolean = (string) => boolean

Map
 - syntaxHighlight.activated: Boolean
 

We want to apply the typecasting as a last operation in the merge function.

@glowcloud
Copy link
Contributor Author

Addressed in #9829

@glowcloud
Copy link
Contributor Author

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