forked from java-json-tools/json-schema-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger bug in "validation loop" handling...
It _is_ possible to enter a same schema pointer via two different paths; the current validation loop detection code only accounts for pointers but not the path! Issue java-json-tools#112. Signed-off-by: Francis Galiegue <[email protected]>
- Loading branch information
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"schema": | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
|
||
"definitions": { | ||
"unit-value": { | ||
"type": "object", | ||
"properties": { | ||
"unit": { | ||
"type": "string" | ||
}, | ||
"value": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"length-unit-value": { | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/unit-value" | ||
}, | ||
{ | ||
"properties": { | ||
"unit": { | ||
"type": "string", | ||
"enum": [ | ||
"cm", | ||
"in" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"something-containing-unit-value": { | ||
"type": "object", | ||
"properties": { | ||
"unit-value": { | ||
"$ref": "#/definitions/unit-value" | ||
} | ||
}, | ||
"required": [ "unit-value"] | ||
} | ||
}, | ||
|
||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/something-containing-unit-value" | ||
}, | ||
{ | ||
"properties": { | ||
"unit-value": { | ||
"$ref": "#/definitions/length-unit-value" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"instance": { | ||
"unit": "cm", | ||
"unit-value": { "unit": "" } | ||
} | ||
} |