question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline dereferencing and fragments

See original GitHub issue

json-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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JamesMessingercommented, Aug 9, 2017

I intend to support inline references in the next version of JSON Schema $Ref Parser, which I have already begun working on. 👍

1reaction
n1ywbcommented, Aug 2, 2017

Internal reference support is a should, however

All fragment identifiers that do not match the JSON Pointer syntax MUST be interpreted as plain name fragment identifiers.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

core definitions and terminology - JSON Schema
Inline dereferencing and fragments. When using inline dereferencing, a resolution scope may lead to a URI which has a non empty fragment part...
Read more >
draft-zyp-json-schema-04 - IETF Datatracker
JSON Schema: core definitions and terminology (Internet-Draft, 2013)
Read more >
Definitions - react-jsonschema-form documentation
This library partially supports inline schema definition dereferencing, which is Barbarian for avoiding to copy and paste commonly used field schemas:
Read more >
Malloc Recitation
Inline functions done at compile time ... The magic happens in dereferencing and arithmetic ... fragmentation (internal vs. external).
Read more >
Pointers in C++
In this case, consider the following code fragment: ... This is done by preceding the pointer name with the dereference operator (*).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found