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

Support recursive schemas #249

Open
baronfel opened this issue Feb 24, 2017 · 1 comment
Open

Support recursive schemas #249

baronfel opened this issue Feb 24, 2017 · 1 comment

Comments

@baronfel
Copy link

baronfel commented Feb 24, 2017

Given a schema like:

  Tree:
    type: object
    required:
    - children
    properties:
      children:
        type: array
        items:
          $ref: '#/Tree'

The parser chokes, specifically being unable to normalize and search the stored maps. If we could detect the circularity and shirt-circuit it then the schema could support these types.

@baronfel
Copy link
Author

baronfel commented Feb 24, 2017

I've got some code changes that check for recursive schemas in arrays by investigating the keys present on the schema.['items'] compared to the current schema, but would love a better check. Is there something native/a polyfill which determines object equality based on keys and value shapes? checking schema vs schema['items'] is logically what we want to do but the objects don't reference compare correctly.

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

1 participant