Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$refs.get() Fails to resolve '#/' #81

Closed
jwalton opened this issue Apr 16, 2018 · 1 comment
Closed

$refs.get() Fails to resolve '#/' #81

jwalton opened this issue Apr 16, 2018 · 1 comment

Comments

@jwalton
Copy link

jwalton commented Apr 16, 2018

$RefParser.resolve({a: 7})
.then($refs =>
    // Prints 7
    console.log($refs.get('#/a'))
)

$RefParser.resolve({a: 7})
.then($refs =>
    // Expected "{a: 7}", but get:
    // Error resolving $ref pointer "/Users/jwalton/myproject/#/".
    // Token "" does not exist.
    console.log($refs.get('#/')) 
)
@handrews
Copy link

@jwalton '#/' would be an object property in the root with the name `` (the empty string). If you wanted the entire document, that is #, not `#/`. This is covered in the JSON Pointer RFC examples.

@jwalton jwalton closed this as completed Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants