-
Notifications
You must be signed in to change notification settings - Fork 0
Fix additionalProperties default value in JTD validator #92
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
- Added BigDecimal fractional part checking in validateInteger method - Added test case testInt32RejectsDecimal() to verify the fix - Ensures all integer types (int8, uint8, int16, uint16, int32, uint32) reject decimal values - Maintains RFC 8927 compliance for integer type validation
… edge case tests
… edge case tests
- Fixed JTD validator to correctly default additionalProperties to false when no properties are defined - Added test case testAdditionalPropertiesDefaultsToFalse() to verify the fix - Updated CI test count from 463 to 464 to account for new test - This ensures RFC 8927 compliance where empty properties schemas reject additional properties by default The bug was in Jtd.java line 446 where additionalProperties was set to true instead of false when both properties and optionalProperties were empty. This caused empty schemas to incorrectly allow additional properties instead of rejecting them by default. Closes #91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
json-java21-jtd/src/test/java/json/java21/jtd/JtdExhaustiveTest.java.backup
Show resolved
Hide resolved
- Removed JtdExhaustiveTest.java from this PR to separate property test development from the bug fix - Backed up the property test as JtdExhaustiveTest.java.backup for future development - Updated CI test count from 464 back to 463 to reflect removal of property test - This allows the additionalProperties bug fix (Issue #91) to be merged independently - The property test can be restored and continued separately after merge
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
This PR fixes issue #91 where the JTD validator incorrectly defaulted additionalProperties to true when no properties were defined.
Changes
The Bug
The JTD validator had incorrect logic where an empty properties schema like would incorrectly allow additional properties instead of rejecting them by default.
The Fix
Changed line 446 in Jtd.java from to to ensure RFC 8927 compliance.
Testing
Closes #91