-
Notifications
You must be signed in to change notification settings - Fork 338
Closed
Description
Given a schema in yaml, which references a sub-schema also in yaml, e.g.:
$id: resource:/schema
type: object
properties:
foo:
$ref: foo.yml
foo.yml
type: object
validate will fail because the resolution of the reference will attempt to parse foo.yml as if it were json:
Caused by: com.networknt.schema.JsonSchemaException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'type': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (BufferedInputStream); line: 1, column: 6]
at app//com.networknt.schema.JsonSchemaFactory.getSchema(JsonSchemaFactory.java:396)
at app//com.networknt.schema.RefValidator.getRefSchema(RefValidator.java:79)
at app//com.networknt.schema.RefValidator.<init>(RefValidator.java:42)
the same example with the sub-schema in json will work as expected:
$id: resource:/schema
type: object
properties:
foo:
$ref: foo.json
foo.json
{"type": "object"}
should retrieving a schema from a URI attempt to detect the format as yaml and parse it as such?
Reactions are currently unavailable