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

Normalize disabled when additional properties is set to true #631

Open
m1212e opened this issue May 10, 2024 · 0 comments · May be fixed by #654
Open

Normalize disabled when additional properties is set to true #631

m1212e opened this issue May 10, 2024 · 0 comments · May be fixed by #654
Labels
bug Something isn't working

Comments

@m1212e
Copy link
Contributor

m1212e commented May 10, 2024

Hi @SaltyAom,

at
/src/utils.ts:273
/src/utils.ts:347

you check the following condition:

if (normalize && schema.additionalProperties === true)
			// @ts-ignore
			compiledValidator.Clean = cleaner

which I think should be the other way around: If normalization is enabled and the schema DOES NOT allow additionalProperties the cleaner should kick in, since then we need to clean out the disallowed fields. If I understand the code correctly, currently we check if normalization is enabled, and if so we only clean when the schema allows additionalProperties, which doesn't make sense since we actually want the additional properties to pass?

@m1212e m1212e added the bug Something isn't working label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant