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

Fix for #70 breaks creates duplicate references #73

Closed
whitlockjc opened this issue Feb 2, 2016 · 0 comments
Closed

Fix for #70 breaks creates duplicate references #73

whitlockjc opened this issue Feb 2, 2016 · 0 comments

Comments

@whitlockjc
Copy link
Owner

When we resolve references recursively, we only want to do this for references that point outside of where we would already be resolving references. What is happening now is that extra references are being recorded in the metadata, which impacts resolution, because we are walking references already intended on being walked. Here is an example:

{
  definitions: {
    A: {
      allOf: [
        {
          $ref: '#/definitions/B'
        }
      ]
    },
    B: {
      allOf: [
        {
          $ref: '#/definitions/C'
        }
      ]
    },
    C: {}
  }
}

reports 3 references instead of two:

#/definitions/A/allOf/0
#/definitions/B/allOf/0
#/definitions/A/allOf/0/allOf/0

The reason for this is we are recursively processing the reference at #/definitions/A/allOf/0 twice, once normally and once as a result of trying to make sure we resolve references outside of where a remote reference might point.

@whitlockjc whitlockjc changed the title Fix for #70 breaks is too aggressive Fix for #70 breaks creates duplicate references Feb 2, 2016
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