java-json-tools / json-schema-validator

A JSON Schema validation implementation in pure Java, which aims for correctness and performance, in that order

Home Page:http://json-schema-validator.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FR: URI is not absolute error: provide location information in ProcessingMessage

Capstan opened this issue · comments

Currently, if you have a malformed id field somewhere in your tree of JSON schema, all you get in the ProcessingMessage of the ProcessingException you get when validation a JSON node is:

fatal: URI "Cluster#" is not absolute
    level: "fatal"
    uri: "Cluster#"

This may not be in the actual JsonNode schema tree being validated, but some n $refs deep.

Normal validation errors at least tell you where in the schema the problem occurs:

schema: {"loadingURI":"http://example.com/foo.json#","pointer":"/schema/Cluster"}

Providing that data would be incredibly useful for tracking down schema problems to exactly which schema or subschema has problematic ids. My current workaround is to manually binary search through which properties bring in the error (by selectively removing them), then descend into the offending $ref and repeat.