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

Strip-extra-keys should not break on non-map values #818

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

Deraen
Copy link
Member

@Deraen Deraen commented Jan 18, 2023

strip-extra-keys-transformer is used for transforming map schemas, but it doesn't check the value being transformed and reduce-kv will fail if given e.g. a string as a value.

Non-map values (like strings) are a valid case for :map schema transforming, as they can be decoded into maps. Reitit however has strip-extra-keys transformer before string-decoding, so strip-extra-keys always sees the string value. But I think transformers shouldn't fail like this in any case.

strip-extra-keys-transformer is used for transforming map schemas, but
it doesn't check the value being transformed and reduce-kv will fail if
given e.g. a string as a value.

Non-map values (like strings) are a valid case for :map schema
transforming, as they can be decoded into maps. Reitit however has
strip-extra-keys transformer before string-decoding, so strip-extra-keys
always sees the string value. But I think transformers shouldn't fail
like this in any case.
@Deraen Deraen merged commit 1e9978c into master Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants