There is currently no support for returning readonly arrays/object. This can be modelled with zod using e.g. z.array(...).readonly() since zod version 3.22.0. When using .readonly the resulting schema would be empty due to missing support from zod-to-json-schema.
Now that the issue has been fixed with zod-to-json-schema version 3.22.0, support can be added to fastify-type-provider-zod simply by upgrading to version 3.22.0 as well.
There is currently no support for returning readonly arrays/object. This can be modelled with
zod
using e.g.z.array(...).readonly()
sincezod
version 3.22.0. When using.readonly
the resulting schema would be empty due to missing support fromzod-to-json-schema
.I raised this issue with
zod-to-json-schema
here: https://github.com/StefanTerdell/zod-to-json-schema/issues/90Now that the issue has been fixed with
zod-to-json-schema
version 3.22.0, support can be added to fastify-type-provider-zod simply by upgrading to version 3.22.0 as well.