Hi, I saw the error in CI:
FAIL tests/emitter-zod.test.ts [ tests/emitter-zod.test.ts ]
TypeError: Cannot read properties of undefined (reading 'OptionalPropertiesPetSchema')
❯ tsp-output/@typespec-tools/emitter-zod/output.ts:63:34
61| export const updatePetSchema = z
62| .function()
63| .args(z.number(), TypeSpec.OptionalPropertiesPetSchema)
| ^
64| .returns(
65| z.union([SinglePetResponseSchema, CommonNotFoundResponseSchema]),
❯ tsp-output/@typespec-tools/emitter-zod/output.ts:73:22
❯ tsp-output/@typespec-tools/emitter-zod/output.ts:46:20
❯ tests/emitter-zod.test.ts:2:31
It can be reproduced locally as well. It seems like there are two issues here:
- OptionalPropertiesPetSchema is placed in a separate
TypeSpec namespace, while it should be in PetStore.
- There is a cyclic dependency between OptionalPropertiesPetSchema and PetStore because of the' kind' field used in the schema.
It seems that this comes from how Typespec handles the scopes, so what can we do with this?
Hi, I saw the error in CI:
It can be reproduced locally as well. It seems like there are two issues here:
TypeSpecnamespace, while it should be inPetStore.It seems that this comes from how Typespec handles the scopes, so what can we do with this?