Inline dereferencing and fragments
See original GitHub issuejson-schema-ref-parser appears to not support a portion of the JSON Schema spec regarding inline dereferencing (see http://json-schema.org/latest/json-schema-core.html#anchor31)
Reproducer: ` var test = { “id”: “http://some.site/schema#”, “not”: { “$ref”: “#inner” }, “definitions”: { “schema1”: { “id”: “#inner”, “type”: “boolean” } } };
deref.dereference(test, function(err, schema){ console.log(err, schema); }); `
Output:
"name": "SyntaxError", "message": "Invalid $ref pointer \"inner\". Pointers must begin with \"#/\"", "stack": "SyntaxError: Invalid $ref pointer \"inner\". Pointers must begin wit h \"#/\"
I understand that this is not a required part of the spec, however it is a SHOULD given that the implementation does support inline dereferencing in general.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top GitHub Comments
I intend to support inline references in the next version of JSON Schema $Ref Parser, which I have already begun working on. 👍
Internal reference support is a should, however
The program crashes with an error on valid schemas because of lack of adherence to this clause. If it’s not going to support internal references, it should ignore them.