File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -121,10 +121,7 @@ app.use(requestMonitoring)
121121
122122const schemaCache = new WeakMap < ZodTypeAny , any > ( ) ;
123123
124- export function zodToOpenApiSchema (
125- zodObj : ZodTypeAny ,
126- nameHint ?: string
127- ) : any { // Prevent infinite recursion
124+ export function zodToOpenApiSchema ( zodObj : ZodTypeAny , ) : any {
128125 if ( schemaCache . has ( zodObj ) ) {
129126 return schemaCache . get ( zodObj ) ;
130127 }
@@ -161,7 +158,7 @@ export function zodToOpenApiSchema(
161158
162159 for ( const key in shape ) {
163160 const child = shape [ key ] ;
164- properties [ key ] = zodToOpenApiSchema ( child , key ) ;
161+ properties [ key ] = zodToOpenApiSchema ( child ) ;
165162 if ( ! child . isOptional ( ) ) required . push ( key ) ;
166163 }
167164
@@ -185,10 +182,7 @@ export function zodToOpenApiSchema(
185182 break ;
186183 }
187184 case 'ZodLazy' :
188- // Recursive schema: use a $ref placeholder name
189- schema = {
190- $ref : `#/components/schemas/${ nameHint ?? 'RecursiveType' } ` ,
191- } ;
185+ schema = { type : 'object' , description : 'Lazy schema - details omitted' } ;
192186 break ;
193187 case 'ZodUnion' :
194188 schema = {
You can’t perform that action at this time.
0 commit comments