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

RangeError when generating mocks #1347

Closed
jclaxton opened this issue May 1, 2024 · 1 comment · Fixed by #1362
Closed

RangeError when generating mocks #1347

jclaxton opened this issue May 1, 2024 · 1 comment · Fixed by #1362
Assignees
Labels
bug Something isn't working mock Related to mock generation
Milestone

Comments

@jclaxton
Copy link

jclaxton commented May 1, 2024

What are the steps to reproduce this issue?

  1. Run orval with the config below, where the input is the attached json.
export default defineConfig({
  evo: {
    output: {
      mode: "tags",
      schemas: "model/api",
      mock: true, 
      prettier: true,
      clean: true, 
    },
    input: {
      target: "./api.json",
    },
  },
});

What happens?

evo - RangeError: Maximum call stack size exceeded
at getMockScalar (node_modules@orval\mock\dist\index.js:255:7)
at resolveMockValue (node_modules@orval\mock\dist\index.js:441:18)
at node_modules@orval\mock\dist\index.js:138:29
at Array.map ()
at getMockObject (node_modules@orval\mock\dist\index.js:130:8)
at getMockScalar (node_modules@orval\mock\dist\index.js:359:14)
at resolveMockValue (node_modules@orval\mock\dist\index.js:423:21)
at node_modules@orval\mock\dist\index.js:138:29
at Array.map ()
at getMockObject (node_modules@orval\mock\dist\index.js:130:8)

What were you expecting to happen?

Generation of types and mocks.

Any logs, error output, etc?

See above.

Any other comments?

Nope.
api.json

What versions are you using?

Operating System: Windows 10
Package Version: 6.28.2
Browser Version: Not relevant

@melloware melloware added bug Something isn't working mock Related to mock generation labels May 1, 2024
@AffeJonsson
Copy link
Contributor

Seems to be the loop SearchResultsDTO -> properties -> resultsByType -> additionalProperties -> ref SearchResultsDTO that isn't detected properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mock Related to mock generation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants