swagger: "2.0"
info:
  title: Circular References
  version: 1.0.0
paths:
  /books:
    get:
      summary: List all books 
      description: here the `related_books` schema is same as `books` schema, creating a circular reference, it should show `recursive` in the model
      tags:
        - Circular References
      responses:
        200:
          description: An array of books
          schema:
            type: array
            items:
              $ref: "#/definitions/Category"
definitions:
  # Store
  Store:
    type: object
    properties:
      title:
        type: string
        example: Book Shop
      categories:
        type: array
        items:
          $ref: "#/definitions/Category"

  # Category
  Category:
    type: object
    properties:
      title:
        type: string
        example: Drama
      books:
        type: array
        items:
          $ref: "#/definitions/Book"
  # Book
  Book:
    type: object
    required:
      - title
      - summary
    properties:
      title:
        type: string
        example: Winnie the Pooh
      summary:
        type: string
        example: Famous children's book
      # related_books is causing an infinite loop
      related_books:
        type: array
        items:
          $ref: "#/definitions/Book"
