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 models are not supported #35

Open
Deadarius opened this issue Apr 30, 2019 · 0 comments · May be fixed by #36
Open

Recursive models are not supported #35

Deadarius opened this issue Apr 30, 2019 · 0 comments · May be fixed by #36

Comments

@Deadarius
Copy link

Deadarius commented Apr 30, 2019

Atttempts to use JSON schemas with definitions that are referencing themselves leads to stack overflow and crash.

Steps to reproduce:

  1. create a schema:
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "folder": {
      "type": "object",
      "title": "Folder Schema",
      "properties": {
        "id": {
          "type": "string",
          "example": "3ba1c69c-3c81-4d6d-b304-873d898b2e3c",
          "format": "uuid"
        },
        "name": {
          "type": "string",
          "example": "Level 1"
        },
        "folders": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/folder"
          }
        }
      },
      "additionalProperties": false,
      "required": ["id", "folders"]
    }
  },
  "type": "object",
  "title": "Folders Response Schema",
  "properties": {
    "data": {
      "$ref": "#/definitions/folder"
    }
  }
}
  1. reference schema in serverless documentation
  2. run serverless openapi generate

Outcome: Error(maximum call stack size exceeded)
Expected: openapi document is generated

@Deadarius Deadarius linked a pull request Apr 30, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant