json-schema-ref-parser
json-schema-ref-parser copied to clipboard
[Feature reques] Support URN id references
It seems that JSON Schemas with references built with URN is not supported, e.g. these schemas:
- github.com/phenopackets/phenopacket-format/schema/condition-schema.json
- github.com/orienteering-oss/iof-orienteering-data-schemas/iof_v3_schema.json
When trying to dereference these, the following error messages are produced respectively:
{
stack: 'ResolverError: Error opening file "urn:jsonschema/:org:phenopackets:api:model:ontology:OntologyClass" \n' +
"ENOENT: no such file or directory, open 'urn:jsonschema/:org:phenopackets:api:model:ontology:OntologyClass'\n" +
' at ReadFileContext.callback (/home/mikaelol/projects/temp/json-parse/node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/file.js:52:20)\n' +
' at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:314:13)',
code: 'ERESOLVER',
message: 'Error opening file "urn:jsonschema/:org:phenopackets:api:model:ontology:OntologyClass" \n' +
"ENOENT: no such file or directory, open 'urn:jsonschema/:org:phenopackets:api:model:ontology:OntologyClass'",
source: 'urn:jsonschema/:org:phenopackets:api:model:ontology:OntologyClass',
path: null,
toJSON: [Function: toJSON],
ioErrorCode: 'ENOENT',
name: 'ResolverError',
footprint: 'null+urn:jsonschema/:org:phenopackets:api:model:ontology:OntologyClass+ERESOLVER+Error opening file "urn:jsonschema/:org:phenopackets:api:model:ontology:OntologyClass" \n' +
"ENOENT: no such file or directory, open 'urn:jsonschema/:org:phenopackets:api:model:ontology:OntologyClass'",
toString: [Function: toString]
}
and
{
stack: 'ResolverError: Error opening file "urn:jsonschema/:iof:v3:Country" \n' +
"ENOENT: no such file or directory, open 'urn:jsonschema/:iof:v3:Country'\n" +
' at ReadFileContext.callback (/home/mikaelol/projects/temp/json-parse/node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/file.js:52:20)\n' +
' at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:314:13)',
code: 'ERESOLVER',
message: 'Error opening file "urn:jsonschema/:iof:v3:Country" \n' +
"ENOENT: no such file or directory, open 'urn:jsonschema/:iof:v3:Country'",
source: 'urn:jsonschema/:iof:v3:Country',
path: null,
toJSON: [Function: toJSON],
ioErrorCode: 'ENOENT',
name: 'ResolverError',
footprint: 'null+urn:jsonschema/:iof:v3:Country+ERESOLVER+Error opening file "urn:jsonschema/:iof:v3:Country" \n' +
"ENOENT: no such file or directory, open 'urn:jsonschema/:iof:v3:Country'",
toString: [Function: toString]
}