Commit 404ebd9
committed
fix(contracts): widen asString return type to string
asString returned the ZodEnum unchanged, so z.infer leaked the literal
union. Consumers bind their own zod for the @anatine/zod-openapi and
@ts-rest/core peers; under zod 4 the union breaks assignments from plain
string data (e.g. certification, gender, known_for_department). Annotate
the return as z.ZodString so the inferred output stays string regardless
of the consumer's zod. Runtime still validates enum membership and the
OpenAPI schema stays type: string.1 parent d2452da commit 404ebd9
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
0 commit comments