Skip to content

Commit 73846df

Browse files
committed
fix: set valid default values in specs
1 parent 397b63f commit 73846df

21 files changed

Lines changed: 42 additions & 42 deletions

File tree

packages/openapi-ts-tests/zod/v3/__snapshots__/2.0.x/mini/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ export const zCallWithDefaultParametersQuery = z.object({
503503
'Success',
504504
'Warning',
505505
'Error'
506-
]), 0),
506+
]), 'Success'),
507507
parameterModel: z._default(z.object({
508508
prop: z.optional(z.string())
509509
}), { prop: 'Hello World!' })
@@ -517,7 +517,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
517517
'Success',
518518
'Warning',
519519
'Error'
520-
])), 0)
520+
])), 'Success')
521521
});
522522

523523
export const zCallToTestOrderOfParamsQuery = z.object({

packages/openapi-ts-tests/zod/v3/__snapshots__/2.0.x/v3/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ export const zCallWithDefaultParametersQuery = z.object({
503503
'Success',
504504
'Warning',
505505
'Error'
506-
]).default(0),
506+
]).default('Success'),
507507
parameterModel: z.object({
508508
prop: z.string().optional()
509509
}).default({ prop: 'Hello World!' })
@@ -517,7 +517,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
517517
'Success',
518518
'Warning',
519519
'Error'
520-
]).optional().default(0)
520+
]).optional().default('Success')
521521
});
522522

523523
export const zCallToTestOrderOfParamsQuery = z.object({

packages/openapi-ts-tests/zod/v3/__snapshots__/2.0.x/v4/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ export const zCallWithDefaultParametersQuery = z.object({
503503
'Success',
504504
'Warning',
505505
'Error'
506-
]).default(0),
506+
]).default('Success'),
507507
parameterModel: z.object({
508508
prop: z.string().optional()
509509
}).default({ prop: 'Hello World!' })
@@ -517,7 +517,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
517517
'Success',
518518
'Warning',
519519
'Error'
520-
]).optional().default(0)
520+
]).optional().default('Success')
521521
});
522522

523523
export const zCallToTestOrderOfParamsQuery = z.object({

packages/openapi-ts-tests/zod/v3/__snapshots__/3.0.x/mini/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ export const zCallWithDefaultParametersQuery = z.object({
12191219
'Success',
12201220
'Warning',
12211221
'Error'
1222-
])), 0),
1222+
])), 'Success'),
12231223
parameterModel: z.nullish(zModelWithString)
12241224
});
12251225

@@ -1231,7 +1231,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
12311231
'Success',
12321232
'Warning',
12331233
'Error'
1234-
])), 0),
1234+
])), 'Success'),
12351235
parameterModel: z.optional(zModelWithString)
12361236
});
12371237

packages/openapi-ts-tests/zod/v3/__snapshots__/3.0.x/v3/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ export const zCallWithDefaultParametersQuery = z.object({
12191219
'Success',
12201220
'Warning',
12211221
'Error'
1222-
]).optional().default(0),
1222+
]).optional().default('Success'),
12231223
parameterModel: zModelWithString.nullish()
12241224
});
12251225

@@ -1231,7 +1231,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
12311231
'Success',
12321232
'Warning',
12331233
'Error'
1234-
]).optional().default(0),
1234+
]).optional().default('Success'),
12351235
parameterModel: zModelWithString.optional()
12361236
});
12371237

packages/openapi-ts-tests/zod/v3/__snapshots__/3.0.x/v4/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ export const zCallWithDefaultParametersQuery = z.object({
12191219
'Success',
12201220
'Warning',
12211221
'Error'
1222-
]).optional().default(0),
1222+
]).optional().default('Success'),
12231223
parameterModel: zModelWithString.nullish()
12241224
});
12251225

@@ -1231,7 +1231,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
12311231
'Success',
12321232
'Warning',
12331233
'Error'
1234-
]).optional().default(0),
1234+
]).optional().default('Success'),
12351235
parameterModel: zModelWithString.optional()
12361236
});
12371237

packages/openapi-ts-tests/zod/v3/__snapshots__/3.1.x/mini/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ export const zCallWithDefaultParametersQuery = z.object({
12371237
'Success',
12381238
'Warning',
12391239
'Error'
1240-
])), 0),
1240+
])), 'Success'),
12411241
parameterModel: z.nullish(zModelWithString)
12421242
});
12431243

@@ -1249,7 +1249,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
12491249
'Success',
12501250
'Warning',
12511251
'Error'
1252-
])), 0),
1252+
])), 'Success'),
12531253
parameterModel: z._default(z.optional(zModelWithString), { prop: 'Hello World!' })
12541254
});
12551255

packages/openapi-ts-tests/zod/v3/__snapshots__/3.1.x/v3/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ export const zCallWithDefaultParametersQuery = z.object({
12371237
'Success',
12381238
'Warning',
12391239
'Error'
1240-
]).optional().default(0),
1240+
]).optional().default('Success'),
12411241
parameterModel: zModelWithString.nullish()
12421242
});
12431243

@@ -1249,7 +1249,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
12491249
'Success',
12501250
'Warning',
12511251
'Error'
1252-
]).optional().default(0),
1252+
]).optional().default('Success'),
12531253
parameterModel: zModelWithString.optional().default({ prop: 'Hello World!' })
12541254
});
12551255

packages/openapi-ts-tests/zod/v3/__snapshots__/3.1.x/v4/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ export const zCallWithDefaultParametersQuery = z.object({
12371237
'Success',
12381238
'Warning',
12391239
'Error'
1240-
]).optional().default(0),
1240+
]).optional().default('Success'),
12411241
parameterModel: zModelWithString.nullish()
12421242
});
12431243

@@ -1249,7 +1249,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
12491249
'Success',
12501250
'Warning',
12511251
'Error'
1252-
]).optional().default(0),
1252+
]).optional().default('Success'),
12531253
parameterModel: zModelWithString.optional().default({ prop: 'Hello World!' })
12541254
});
12551255

packages/openapi-ts-tests/zod/v4/__snapshots__/2.0.x/mini/default/zod.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ export const zCallWithDefaultParametersQuery = z.object({
503503
'Success',
504504
'Warning',
505505
'Error'
506-
]), 0),
506+
]), 'Success'),
507507
parameterModel: z._default(z.object({
508508
prop: z.optional(z.string())
509509
}), { prop: 'Hello World!' })
@@ -517,7 +517,7 @@ export const zCallWithDefaultOptionalParametersQuery = z.object({
517517
'Success',
518518
'Warning',
519519
'Error'
520-
])), 0)
520+
])), 'Success')
521521
});
522522

523523
export const zCallToTestOrderOfParamsQuery = z.object({

0 commit comments

Comments
 (0)