Skip to content

Error Maximum call stack size exceeded when schema grows #2640

@AlbinaBlazhko17

Description

@AlbinaBlazhko17

Describe the bug
When the openapi specification grows and has a huge list that we need to distinguish between, I got the error Ajv error: Maximum call stack size exceeded while executing respect.

To Reproduce

  1. Using provided example run mock server and then run redocly respect openapi.arazzo.yaml
  2. Receive Ajv error: Maximum call stack size exceeded

Expected behavior
Respect command executes successfully.

Logs
Image

OpenAPI description
Provided archive.

Redocly version(s)
2.20.2

Node.js version(s)
24

OS, environment
macOs

Additional context
I investigated a little bit and when i comment discriminator: true in Ajv instance inside the file: packages/respect-core/src/modules/flow-runner/schema/schema-checker.ts i didn't receive an error.

One of our customer reported, that the error occurs when the number of enum values exceeds 126.

call-stack-repro.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    JSON SchemaRespectRelated to the `respect` command which works with Arazzo specificationType: BugSomething isn't workingp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions