ts-rest / ts-rest

RPC-like client, contract, and server implementation for a pure REST API
https://ts-rest.com
MIT License
2.11k stars 91 forks source link

Export a Zod response schema that matches the request validation error responses #582

Open Gabrola opened 2 months ago

Gabrola commented 2 months ago

Related to #476

Would be a good idea to export a Zod response schema that can be added by ts-rest users to their contracts if they decide to keep the default request validation error responses.

Important to note that we have different formats, see https://github.com/ts-rest/ts-rest/blob/308b966/libs/ts-rest/express/src/lib/ts-rest-express.ts#L257-L276

ankiiisharma commented 2 months ago

hey @Gabrola , can you please elaborate this more? like what exactly do you want?

lrwlf commented 1 month ago

I'm taking a look at this issue and will attempt a fix.