Skip to content

Ability to adjust ZodSerializerInterceptor behaviour #118

Closed Answered by BenLorantfy
devnaumov asked this question in Q&A
Discussion options

You must be logged in to vote

You can create a DTO for the response shape you want:

const DataItem = z.object({ ... });

class ResponseDto extends createZodDto(z.object({
  data: z.array(DataItem)
})) {}

@ZodSerializerDto(ResponseDto)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BenLorantfy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #116 on November 10, 2024 19:50.