You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature request to add the ability to use the default property from an OpenAPI schema property, to apply that value to the Zod schema object. For example a property of:
Thanks so much for the fast PR on this, that's super appreciated! I gave it a shot tonight and it works great thank you!
I did want to report two possible issues, keeping in mind I manually packed the various packages and locally imported them, so there is a chance I messed something up in that process, but figured I'd report them anyway for now:
Looks like there are new lines missing in the generated TS file. For example in one of my schemas it comes out to:
On one of my large schemas, I am getting a call stack size exceeded error trying to generate it now, if mocks are enabled. It works when mocks are disabled or when using 7.5.0. A simpler schema such as petstore works no problem however.
This one I'm more inclined to think I messed something up with the local packaging so feel free to ignore this one and I can re-test when 7.6.0 is actually released, but if not, I am happy to share my schema privately.
🛑 schema - RangeError: Maximum call stack size exceeded
at {{projectDirectory}}\node_modules\.pnpm\@orval+mock@file+lib+orval+orval-mock-7.6.0pre.tgz\node_modules\@orval\mock\dist\index.js:183:16
at Array.map (<anonymous>)
at getMockObject ({{projectDirectory}}\node_modules\.pnpm\@orval+mock@file+lib+orval+orval-mock-7.6.0pre.tgz\node_modules\@orval\mock\dist\index.js:159:36)
at getMockScalar ({{projectDirectory}}\node_modules\.pnpm\@orval+mock@file+lib+orval+orval-mock-7.6.0pre.tgz\node_modules\@orval\mock\dist\index.js:419:14)
at resolveMockValue ({{projectDirectory}}\node_modules\.pnpm\@orval+mock@file+lib+orval+orval-mock-7.6.0pre.tgz\node_modules\@orval\mock\dist\index.js:543:21)
at getMockScalar ({{projectDirectory}}\node_modules\.pnpm\@orval+mock@file+lib+orval+orval-mock-7.6.0pre.tgz\node_modules\@orval\mock\dist\index.js:358:11)
at resolveMockValue ({{projectDirectory}}\node_modules\.pnpm\@orval+mock@file+lib+orval+orval-mock-7.6.0pre.tgz\node_modules\@orval\mock\dist\index.js:593:18)
at {{projectDirectory}}\node_modules\.pnpm\@orval+mock@file+lib+orval+orval-mock-7.6.0pre.tgz\node_modules\@orval\mock\dist\index.js:169:29
at Array.map (<anonymous>)
at getMockObject ({{projectDirectory}}\node_modules\.pnpm\@orval+mock@file+lib+orval+orval-mock-7.6.0pre.tgz\node_modules\@orval\mock\dist\index.js:159:36)
The line in question is from getMockObject and is:
imports2.push(...resolvedValue.imports);
Neither are a big deal however for me personally, but wanted to report just in case. Thank you again!
Feature request to add the ability to use the
default
property from an OpenAPI schema property, to apply that value to the Zod schema object. For example a property of:Would generate a Zod object with the following property (assuming the above schema was used in a list endpoint):
To maintain backward compatibility, it could be behind a config option, at the most basic level a bool:
Thank you for this great library!
The text was updated successfully, but these errors were encountered: