title: Swagger-UI Maximum call stack size exceeded -> Backreference
body: <p>When calling my swagger.json from the swagger-ui I get an error:</p>
  
  <blockquote>
    <p>Maximum call stack size exceeded</p>
  </blockquote>
  
  <p>I guess it is because I have</p>
  
  <p><code>Token</code> which has an owner of Type <code>User</code></p>
  
  <p><code>User</code> which has a Token of Type <code>Token</code></p>
  
  <p>When using the online-version of the swagger editior it can resolve the types. How can I configure swagger to resolve the types correctly?</p>
  
  <p>The full <code>swagger.json</code></p>
  
  <pre><code>{
      "swagger": "2.0",
      "info": {
          "description": "Descr",
          "version": "1.0.0",
          "title": "Skeleton"
      },
      "host": "1.1.1.1:11",
      "basePath": "/api",
      "tags": [{
              "name": "auth"
          }
      ],
      "schemes": ["http"],
      "paths": {
          "/auth/local": {
              "post": {
                  "tags": ["auth"],
                  "summary": "Authenticates User",
                  "description": "This auths only local users",
                  "operationId": "authenticateUser",
                  "consumes": ["application/json"],
                  "produces": ["application/json"],
                  "parameters": [{
                          "in": "body",
                          "name": "body",
                          "required": false,
                          "schema": {
                              "$ref": "#/definitions/Credentials"
                          }
                      }
                  ],
                  "responses": {
                      "200": {
                          "description": "successful operation",
                          "schema": {
                              "$ref": "#/definitions/AuthResponse"
                          }
                      }
                  }
              }
          },
          "/auth/ldap": {
              "post": {
                  "tags": ["auth"],
                  "operationId": "authenticateLdapUser",
                  "produces": ["application/json"],
                  "parameters": [{
                          "in": "body",
                          "name": "body",
                          "required": false,
                          "schema": {
                              "$ref": "#/definitions/Credentials"
                          }
                      }
                  ],
                  "responses": {
                      "default": {
                          "description": "successful operation"
                      }
                  }
              }
          }
      },
      "definitions": {
          "AuthResponse": {
              "type": "object",
              "properties": {
                  "issued": {
                      "type": "string",
                      "format": "date-time"
                  },
                  "responseType": {
                      "type": "string",
                      "enum": ["RESPONSE", "ERROR", "UNAUTHORIZED", "OK"]
                  },
                  "responseDescription": {
                      "type": "string"
                  },
                  "accessToken": {
                      "$ref": "#/definitions/Token"
                  },
                  "resourceName": {
                      "type": "string"
                  }
              }
          },
          "Note": {
              "type": "object",
              "properties": {
                  "id": {
                      "type": "integer",
                      "format": "int32"
                  },
                  "content": {
                      "type": "string"
                  },
                  "modified": {
                      "type": "string",
                      "format": "date-time"
                  }
              }
          },
          "Token": {
              "type": "object",
              "properties": {
                  "id": {
                      "type": "string"
                  },
                  "expirationDate": {
                      "type": "string",
                      "format": "date-time"
                  },
                  "issued": {
                      "type": "string",
                      "format": "date-time"
                  },
                  "expired": {
                      "type": "boolean"
                  },
                  "owner": {
                      "$ref": "#/definitions/User"
                  }
              }
          },
          "User": {
              "type": "object",
              "properties": {
                  "username": {
                      "type": "string"
                  },
                  "password": {
                      "type": "string"
                  },
                  "email": {
                      "type": "string"
                  },
                  "displayName": {
                      "type": "string"
                  },
                  "notes": {
                      "type": "array",
                      "items": {
                          "$ref": "#/definitions/Note"
                      }
                  },
                  "accessToken": {
                      "$ref": "#/definitions/Token"
                  }
              }
          },
          "Credentials": {
              "type": "object",
              "properties": {
                  "user": {
                      "type": "string"
                  },
                  "password": {
                      "type": "string"
                  }
              }
          }
      }
  }
  </code></pre>