-
Notifications
You must be signed in to change notification settings - Fork 331
Closed
Description
Suppose we have a schema at http://example.com/schema.json that looks like this:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"oneOf": [
{
"$ref": "#/definitions/one"
},
{
"$ref": "#/definitions/two"
}
],
"definitions": {
"one": {
"type": "integer",
"enum": [1]
},
"two": {
"type": "integer",
"enum": [2]
}
}
}
If the "one" subschema is referenced through another schema ("$ref": "http://example.com/schema.json#/definitions/one"
), then data will only be validated against the subschema - 1
will pass validation while 2
will fail.
Currently, however, if the same URI is used in a schema factory (jsonSchemaFactory.getSchema(new URI("http://example.com/schema.json#/definitions/one"))
), then the fragment part of the URI is ignored and both 1
and 2
will pass validation.
It would be great if getSchema() would behave the same way as $ref and only return the referenced subschema.
Metadata
Metadata
Assignees
Labels
No labels