export type IdOrUndefined = z.infer<typeof IdOrUndefined>;
export const IdOrUndefined = Id.nullable();
export type Id = z.infer<typeof Id>;
export const Id = z.string();
Which contains the following error:
Block-scoped variable 'Id' used before its declaration.ts(2448)
myTest.gen.ts(23, 14): 'Id' is declared here.
Variable 'Id' is used before being assigned.ts(2454)
const Id: z.ZodString
Expected behavior:
It should generate valid TS code for any order in which components are declared.
The order in which the components are declared might cause TS errors when we use
$ref
.Current behavior:
The following yaml:
Generates the following code:
Which contains the following error:
Expected behavior: It should generate valid TS code for any order in which components are declared.