Skip to content

Maximum call stack size exceeded, @yellow-ticket/json-seed-schema #72

Description

@NGimbal

Description

When mocking a complex third-party API schema (dots API), we're encountering a "Maximum call stack size exceeded" error. The package appears to enter an infinite recursion loop when attempting to generate mock data based on the schema structure. This is causing our application to crash when trying to load specific routes.

Reproduction steps

  1. Use fromOpenApi(spec) with the open api schema attached
  2. Hit the "/v2/transfers/{transfer_id}" endpoint
  3. Observe the application crash with "RangeError: Maximum call stack size exceeded"

This is the schema:
https://github.com/Send-Dots/dots-docs-v2/blob/master/docs/v2.yaml

I have to convert it to json from the yaml file.

dots.spec.json

Expected behavior

Limit recursion depth by default / with a configuration.

Initial assessment

It's probably a problem with the schema, but that's not something that I have control over since it's a third party api. I feel like this is the expectation for @mswjs/source users.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions