From 5d3be541137cdf5891780a9c2db0f42929e8cba6 Mon Sep 17 00:00:00 2001 From: Maece Fischer Date: Wed, 25 Sep 2024 21:21:55 +0200 Subject: [PATCH] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00b5a742..184ad649 100644 --- a/README.md +++ b/README.md @@ -327,8 +327,8 @@ Anyway, React stuff is out-of-scope of this package. ### ZodValidationRequestHandler This implementation is responsible for validating the request and response data through their Zod schemas. This one is only available when Zod schemas are generated due to the `withZod: true` configuration. -This request handler does throw an error when requests or responses do not comply with the -zod schema definitions which are defined inside the requests' `endpointSchema` property. +This request handler does `reject` the promise with the Zod error when requests or responses do not comply with the +Zod schema definitions which are defined in the requests' `endpointSchema` property. It uses the [safeParse](https://zod.dev/?id=safeparse) method for this task. ## Promises: `resolve` vs `reject`