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

feat(NODE-1921)!: validate serializer root input #537

Merged
merged 9 commits into from
Dec 13, 2022

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Dec 7, 2022

Description

What is changing?

  • Added validation to the root input for serialize
  • Adjusted the internal fn prototypes to no longer have optional arguments (avoids the bug we had with serializeFunctions)
  • Fixed lack of cyclic reference check for Code w/ scope and DBRef fields (TODO: need to add a test)
  • Added cyclic ref checks that test a wider array of object arrangements
  • Moved the EJSON circular tests to the same file, organizational change only
  • Fixed breakage introduced in feat!(NODE-4410): only enumerate own properties #527 where nullish input caused an error

What is the motivation for this change?

Arrays cannot be root BSON documents, see migration guide.

Double check the following

  • Ran npm run lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Dec 8, 2022
@nbbeeken nbbeeken changed the title feat!(NODE-1921): validate serializer root input feat(NODE-1921)!: validate serializer root input Dec 9, 2022
@nbbeeken nbbeeken requested a review from durran December 12, 2022 19:31
durran
durran previously approved these changes Dec 12, 2022
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

I looked at the migration guide and how we're validating inputs into serialize. LGTM

@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Dec 13, 2022
@durran durran merged commit 95d5edf into main Dec 13, 2022
@durran durran deleted the NODE-1921-serializer-input-validation branch December 13, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants