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

Top-level $ref throws exception #415

Closed
letmaik opened this issue Oct 19, 2021 · 1 comment
Closed

Top-level $ref throws exception #415

letmaik opened this issue Oct 19, 2021 · 1 comment

Comments

@letmaik
Copy link

letmaik commented Oct 19, 2021

Repro:

{
    "$schema": "https://json-schema.org/draft/2019-09/schema",
    "$ref": "#/$defs/Document",

    "$defs": {
        "Document": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "createdBy": {
                    "type": "string"
                }
            }
        }
    }
}

Error:

Error: Refs should have been resolved by the resolver! { '$schema': 'https://json-schema.org/draft/2019-09/schema',
  '$ref': '#',
  id: 'Demo',
  definitions: 
   { Document: 
      { type: 'object',
        properties: [Object],
        required: [],
        additionalProperties: true } } }
    at parseNonLiteral (bundle.js:14526)
    at parseAsTypeWithCache (bundle.js:14437)
    at Object.parse (bundle.js:14396)
    at Object.<anonymous> (bundle.js:41815)
    at step (bundle.js:41715)
    at Object.next (bundle.js:41696)
    at fulfilled (bundle.js:41687)
@jrehwaldt
Copy link

I believe this is a duplicate of #132.

@letmaik letmaik closed this as completed Jan 3, 2022
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