Input Validation
We use zod for input validation , and inference of input parameters.
Install Zod
- npm
- pnpm
Validation with Zod
You can add inputs to you REST endpoints by invoking the input
method.
All of you data are validated with zod before passed into the function , So we also get Runtime Validation with Zod.
How we handle Input in Sveltekit-Rest
All of you inputs are passed in the Request Body for HTTP the following HTTP Methods.
- POST
- PUT
- PATCH
- DELETE
We pass the inputs as Query Params for the following HTTP Method.
- GET
Your Inputs are passed as Encoded URI on GET Method