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

Maximum call stack size exceeded with self-referencing objects on .resolve #36

Closed
bbqsrc opened this issue Apr 4, 2017 · 2 comments
Closed

Comments

@bbqsrc
Copy link

bbqsrc commented Apr 4, 2017

The following causes RangeError: Maximum call stack size exceeded:

const obj = {
  definitions: {
    Self: {
      properties: {
        self: { $ref: "#/definitions/Self" }
      }
    }
  }
}

require("json-schema-ref-parser").resolve(obj, (err, schema) => console.log(err, schema))
@philsturgeon
Copy link
Member

philsturgeon commented May 21, 2021

Your JS now outputs this in 9.0.7.

null <ref *1> $Refs {
  circular: false,
  '_$refs': {
    '/private/tmp/': $Ref {
      path: '/private/tmp/',
      value: [Object],
      '$refs': [Circular *1],
      pathType: 'file',
      errors: undefined
    }
  },
  '_root$Ref': $Ref {
    path: '/private/tmp/',
    value: { definitions: [Object] },
    '$refs': [Circular *1],
    pathType: 'file',
    errors: undefined
  }
}

@P0lip that circular reference is something we fixed in our fork right? Can we get that back upstream somehow?

@philsturgeon
Copy link
Member

Loads of circular issues fixed in 9.0.x so let's assume we're good here. If not, please reopen.

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