Closed crutcher closed 9 months ago
This affects JSD $anchor/$id "#target" fragment targets.
JsonSchemaFactory.getSchema("...#target...") silently retrieves the base URI schema.
The cause is this line in getMappedSchema():
getMappedSchema()
JsonNode subSchemaNode = document.getRefSchemaNode(schemaLocation.getFragment().toString());
The returned fragment is passed to getRefSchemaNode() without a # prefix, which prevents it being treated as an anchor reference.
getRefSchemaNode()
#
A simple solution appears to be adding "#" + to the call; and that passes all the existing tests. I'm investigating writing a full test for this.
"#" +
This affects JSD $anchor/$id "#target" fragment targets.
JsonSchemaFactory.getSchema("...#target...") silently retrieves the base URI schema.
The cause is this line in
getMappedSchema()
:The returned fragment is passed to
getRefSchemaNode()
without a#
prefix, which prevents it being treated as an anchor reference.A simple solution appears to be adding
"#" +
to the call; and that passes all the existing tests. I'm investigating writing a full test for this.