File tree 3 files changed +5
-2
lines changed
3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -388,6 +388,7 @@ export type ZodOptions = {
388
388
body ?: Mutator ;
389
389
response ?: Mutator ;
390
390
} ;
391
+ generateEachHttpStatus ?: boolean ;
391
392
} ;
392
393
393
394
export type ZodCoerceType = 'string' | 'number' | 'boolean' | 'bigint' | 'date' ;
@@ -414,6 +415,7 @@ export type NormalizedZodOptions = {
414
415
body ?: NormalizedMutator ;
415
416
response ?: NormalizedMutator ;
416
417
} ;
418
+ generateEachHttpStatus : boolean ;
417
419
} ;
418
420
419
421
export type HonoOptions = {
Original file line number Diff line number Diff line change @@ -286,6 +286,7 @@ export const normalizeOptions = async (
286
286
}
287
287
: { } ) ,
288
288
} ,
289
+ generateEachHttpStatus : outputOptions . override ?. zod ?. generateEachHttpStatus ?? false ,
289
290
} ,
290
291
swr : {
291
292
...( outputOptions . override ?. swr ?? { } ) ,
@@ -463,6 +464,7 @@ const normalizeOperationsAndTags = (
463
464
}
464
465
: { } ) ,
465
466
} ,
467
+ generateEachHttpStatus : zod ?. generateEachHttpStatus ?? false ,
466
468
} ,
467
469
}
468
470
: { } ) ,
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import {
25
25
ZodCoerceType ,
26
26
generateMutator ,
27
27
GeneratorMutator ,
28
- GlobalMockOptions ,
29
28
} from '@orval/core' ;
30
29
import uniq from 'lodash.uniq' ;
31
30
@@ -680,7 +679,7 @@ const generateZodRoute = async (
680
679
} ) ;
681
680
682
681
const responses = (
683
- ( context . output . mock as GlobalMockOptions ) ? .generateEachHttpStatus
682
+ context . output . override . zod . generateEachHttpStatus
684
683
? Object . entries ( spec ?. [ verb ] ?. responses ?? { } )
685
684
: [ [ '' , spec ?. [ verb ] ?. responses [ 200 ] ] ]
686
685
) as [ string , ResponseObject | ReferenceObject ] [ ] ;
You can’t perform that action at this time.
0 commit comments