Skip to content

chore: inspect for mutations in serialization methods #2327

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

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

MaggieKimani1
Copy link
Contributor

@MaggieKimani1 MaggieKimani1 commented Apr 15, 2025

Adds a unit test to inspect whether we mutate any public properties in the DOM by:

  • Adding a complete OpenApi document - with 3.1 features and loading it into a DOM
  • Serializing the DOM using a standard serializer - System.Text.JSON
  • Serializing the same DOM using our current serialization infrastructure
  • Serializing the DOM again using STJ
  • Doing a deep comparison for the two STJ-serialized versions. If they're different, our custom serialization likely mutated the public DOM.

Fixes #2080

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Great start! a couple of comments to help finalize this.

@MaggieKimani1 MaggieKimani1 marked this pull request as ready for review April 16, 2025 13:07
@MaggieKimani1 MaggieKimani1 requested a review from a team as a code owner April 16, 2025 13:07
@MaggieKimani1 MaggieKimani1 enabled auto-merge April 16, 2025 13:08
Copy link

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Great work!

@MaggieKimani1 MaggieKimani1 merged commit bb9f706 into main Apr 16, 2025
16 checks passed
@MaggieKimani1 MaggieKimani1 deleted the fix/test-for-mutations-during-serialization branch April 16, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2 - inspect for mutations in serialization methods
2 participants