Closed gimenete closed 1 year ago
Hey @gimenete, i'm planning on deprecating the current types and replacing it with zod, then all these field parameters like what you are asking will became available What do you think of this change to mainly use zod as definition and validation?
@G4brym that'd be awesome. In fact I'm already using zod and from it I generate the open api types. See my comment here https://github.com/cloudflare/itty-router-openapi/issues/47#issuecomment-1531180686
So using zod directly would be much simpler!
yeah, your commant was what started an internal discussion to just use zod directly
@G4brym hi friend, is there any chance of instead of just using Zod make it pluggable? Personally I would like to use ArkType :) https://arktype.io/
any updates on this? Zod will be super useful :)
It'd be great to have support for
minLength
andmaxLength
.Specially when you have a limit for a column in the database, it'd be nice to have the API to limit the value already and not have to do it manually inside the endpoint implementation.
This would also be useful for checking that a value is not an empty string by using
minLength: 1
, which is pretty common, I think.