We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 396e75d commit e7d350eCopy full SHA for e7d350e
1 file changed
express-zod-api/src/io-schema.ts
@@ -20,10 +20,7 @@ export const getFinalEndpointInputSchema = <
20
>(
21
middlewares: AbstractMiddleware[],
22
input: IN,
23
-): z.ZodIntersection<MIN, IN> => {
24
- const allSchemas: IOSchema[] = R.pluck("schema", middlewares);
25
- allSchemas.push(input);
26
- return allSchemas.reduce((acc, schema) =>
27
- acc.and(schema),
28
- ) as z.ZodIntersection<MIN, IN>;
29
-};
+) =>
+ R.pluck("schema", middlewares)
+ .concat(input)
+ .reduce((acc, schema) => acc.and(schema)) as z.ZodIntersection<MIN, IN>;
0 commit comments