Please look here for example implementation #23
const signup = new OpenAPIHono<{ Variables: ContextVars }>({
defaultHook: (result, c) => {
if (!result.success) {
const response = processZodError<SignupSchema>('Invalid form', result.error);
return c.json(response, 422);
}
}
}).openapi(signupSpec,....)
We can do this for every validation we want the bad part would only be the query default that we impose for example
export const queryParamsSchema = object({
q: string().default(''),
page: number().default(0),
limit: number().default(10)
});
Where we have to put the logic always on the routes that uses it.
@gestanestle please read thanks!
Please look here for example implementation #23
We can do this for every validation we want the bad part would only be the query default that we impose for example
Where we have to put the logic always on the routes that uses it.
@gestanestle please read thanks!