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

Recursive references.... again! #91

Closed
saharj opened this issue Aug 17, 2016 · 2 comments
Closed

Recursive references.... again! #91

saharj opened this issue Aug 17, 2016 · 2 comments

Comments

@saharj
Copy link

saharj commented Aug 17, 2016

Recursive references has been an issue for a long time in Swagger Editor. See (swagger-api/swagger-editor#1005, #69, swagger-api/swagger-editor#1012, swagger-api/swagger-editor#1052 and #73).

For Swagger Editor rendering the optimal outcome of a self-referring reference is to resolve it up to N levels.

Can we have an option for resolving recursive references up to N level? It would help Swagger Editor and other UI tools to render the JSON Schemas better.

To see it yourself, paste this Swagger file in Swagger Editor:

---
swagger: '2.0'
info:
  version: 0.0.0
  title: Simple API
paths:
  /:
    get:
      responses:
        200:
          description: OK
definitions:
  person:
    properties:
      friends:
        type: array
        items:
          $ref: "#/definitions/person"
@whitlockjc
Copy link
Owner

This is a duplicate of #74.

@jeff9finger
Copy link

jeff9finger commented Aug 17, 2016

I have a spec that circular references as well. And not always directly.

swagger: '2.0'
info:
  version: 0.0.0
  title: Simple API
paths:
  /:
    get:
      responses:
        200:
          description: OK
definitions:
  service:
    properties:
      name:
        type: string
      account:
        $ref: "#/definitions/account"

  account:
    properties:
      services:
        type: array
        items:
          $ref: "#/definitions/service"

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

3 participants