Closed vmgarcia closed 1 year ago
Oh, body should only be declared once if you want to have them merged. The double declaration is for unions (one body or another). You can declare it like this :
export const parameters = makeParameters([
{
name: 'UserNewTask',
description: "'The definition of the new task being created",
schema: z.object({ userId: z.number()}).merge(askSchema.omit({ id: true, createdAt: true })),
type: 'Body',
}
]);
would you like to propose an improvement to documentation to explain this behaviour with more exemples ? Improving the docs is straightforward. All is in markdown in /website directory. I would love to have users help improve the docs with concrete exemples.
The type inference generated from the code below does not work as expected.
I expect
req.body
to be equivalent toInstead it's
I'm not sure if this is the intended behavior, it's not intuitive or explained in the docs.
As a workaround I'm just using