Open
Description
Description
Hi @mrlubos,
I've encountered a "Maximum call stack size exceeded" error when using the zod plugin with a recursive schema. The issue appears to be related to the order of schema definitions in the openapi.yaml file.
Steps to Reproduce:
- Define schemas in openapi.yaml in the order A → B.
- Run the build process.
- The build fails with the "Maximum call stack size exceeded" error.
Workaround: Reordering the schema definitions to B → A allows the build to succeed.
Other plugins work
Please let me know if more details are needed.
Reproducible example or configuration
export default defineConfig({
input: "./openapi.yaml",
output: "./src/client",
plugins: ["zod"],
});
OpenAPI specification (optional)
Failing:
components:
schemas:
A:
additionalProperties: false
properties:
b:
$ref: "#/components/schemas/B"
required:
- b
type: object
B:
additionalProperties: false
properties:
bs:
items:
$ref: "#/components/schemas/B"
type:
- array
- "null"
required:
- bs
type: object
info:
title: API
version: development
openapi: 3.1.0
Working:
components:
schemas:
B:
additionalProperties: false
properties:
bs:
items:
$ref: "#/components/schemas/B"
type:
- array
- "null"
required:
- bs
type: object
A:
additionalProperties: false
properties:
b:
$ref: "#/components/schemas/B"
required:
- b
type: object
info:
title: API
version: development
openapi: 3.1.0
System information (optional)
@hey-api/openapi-ts: v0.64.4
node: v20.18.1
Activity