-
Notifications
You must be signed in to change notification settings - Fork 331
apply default in objects and arrays #477
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
Conversation
mvn test results in 4 errors
|
…reset() after each test
Reminder about this review in case you missed it @prashanthjos . @stevehu I did the performance tests and replied in the thread, and to my surprise found that the code is faster after my changes. |
@SiemelNaran That is good news :) Let us know when you think the PR is completed so that we can start the review. Thanks a lot for the effort. |
It is ready. |
At https://json-schema.org/understanding-json-schema/reference/generic.html they say of the default keyword
So before this PR, the 'default' keyword is ignored during both validation and walking. But this PR allow the user to apply defaults during walking. They still have to set a flag indicating that they want defaults to be applied (and they can apply defaults only if property is missing, or if it missing or is explicitly null).
If JSON blobs were saved to the database, and the JSON schema changed to add defaults, the db migration tool could use read the JSON blobs and walk them against the schema again to apply defaults.