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

fix: forbidUnknownValues should default true when validatorOptions undefined #2196

Merged
merged 11 commits into from
Jan 15, 2024

Conversation

cduff
Copy link
Contributor

@cduff cduff commented Aug 9, 2023

Description

forbidUnknownValues is supposed to default to true. This wasn't the case when validatorOptions was undefined. This PR corrects that and adds a test for it. It also corrects some related code doc.

Checklist

  • the pull request title describes what this PR does (not a vague title like Update index.md)
  • the pull request targets the default branch of the repository (develop)
  • the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • tests are added for the changes I made (if any source code was modified)
  • documentation added or updated
  • I have run the project locally and verified that there are no errors

Fixes

fixes #1906

Copy link
Member

@braaar braaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few changes, but this looks good!

src/validation/ValidatorOptions.ts Outdated Show resolved Hide resolved
test/functional/validator-options.spec.ts Outdated Show resolved Hide resolved
@cduff
Copy link
Contributor Author

cduff commented Aug 10, 2023

Thanks for your review @braaar. I just made changes based on your feedback. Hopefully it's good to merge now?

Copy link
Member

@braaar braaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should maybe add a test where you pass {} as the options object

test/functional/validator-options.spec.ts Outdated Show resolved Hide resolved
@cduff
Copy link
Contributor Author

cduff commented Aug 10, 2023

You should maybe add a test where you pass {} as the options object

@braaar Good idea. Done.

@cduff
Copy link
Contributor Author

cduff commented Aug 13, 2023

@braaar any other changes needed to get this merged?

@braaar
Copy link
Member

braaar commented Aug 14, 2023

@braaar any other changes needed to get this merged?

Probably not, but we'll have to wait for @NoNameProvided's review

@cduff
Copy link
Contributor Author

cduff commented Aug 15, 2023

@braaar I just made another commit based on your feedback. Let me know if anything else is required to get this merged.

@cduff
Copy link
Contributor Author

cduff commented Sep 12, 2023

Any chance of getting this small PR reviewed & merged @NoNameProvided?

@cduff cduff requested a review from braaar January 15, 2024 00:58
@cduff
Copy link
Contributor Author

cduff commented Jan 15, 2024

@braaar @NoNameProvided Any chance of getting this small PR reviewed & merged?

@braaar
Copy link
Member

braaar commented Jan 15, 2024

Thanks for the contribution!

@braaar braaar merged commit 9c49bd6 into typestack:develop Jan 15, 2024
5 checks passed
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

fix: forbidUnknownValues doesn't default to true when validatorOptions are undefined
2 participants