Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #1174 by preventing non-schema JSON node types (notably TextNode) from being treated as valid JSON Schemas, which previously could result in “accept anything” behavior due to empty validator sets.
Changes:
- Add validation in
SchemaRegistryto reject schema root nodes that are neither an object nor (where supported) a boolean. - Add regression tests covering
TextNoderoot schemas and boolean-schema support differences between Draft 4 and Draft 7.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/test/java/com/networknt/schema/Issue1174Test.java | Adds regression tests for rejecting TextNode schemas and for boolean-schema behavior across drafts. |
| src/main/java/com/networknt/schema/SchemaRegistry.java | Adds schema node null/type validation and draft-aware boolean-schema acceptance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Viewed spec.yaml:39-84 This is an excellent pull request for specification compliance and strictness. Here is my review of the changes in PR #1250: 1. Strict Schema Node Type ValidationThe most significant change is the introduction of strict type validation for schema nodes ( This strictness is so effective that it actually caught several malformed schemas in your own test suite! For example:
2. Specification-Aware Boolean SchemasThe PR correctly implements boolean schema support based on the JSON Schema draft version. By introducing 3. Graceful Fragment ResolutionThe overloaded ConclusionThis PR massively improves the robustness of the validator. It prevents users from writing silent bugs in their JSON schemas (like typing Everything looks great and ready to merge! |
No description provided.