Skip to content

Conversation

@orgads
Copy link

@orgads orgads commented Dec 24, 2025

Skip the 'required property not found' error if the property has a default value defined, since the default will be added to the patch by the existing reverse search loop.

Skip the 'required property not found' error if the property has a
default value defined, since the default will be added to the patch
by the existing reverse search loop.
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@fb270d5). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #371   +/-   ##
=======================================
  Coverage        ?   93.52%           
=======================================
  Files           ?        7           
  Lines           ?     1066           
  Branches        ?        0           
=======================================
  Hits            ?      997           
  Misses          ?       69           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pboettch
Copy link
Owner

As much as I like the cleanliness of your implementation, as the default field is not a requirement of the standard, standard-compliant validation has to fail, even if a default value is provided.

At least that is my understanding.

Can you prove me otherwise?

@orgads
Copy link
Author

orgads commented Dec 24, 2025

You're probably right. ajv does accept required fields with default values, but I also tester with another validator (I think blaze), and it didn't so I guess this can be closed.

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.

3 participants