Allow partial success during parsing #945
-
const zNullableString = z
.string()
.nullish()
.transform((s) => s ?? '');
const zApiResponse = z.object({
total: z.number(),
pagination: z.object({
from: z.number().int().positive(),
size: z.number().int().positive(),
}),
records: z.array(zRecord),
});
const zRecord = z.object({
id: z.string().uuid(),
name: zNullableString,
email: zNullableString,
address: z
.object({
street: zNullableString,
city: zNullableString,
state: zNullableString,
country: zNullableString,
})
.nullable(),
}); Say I have the above schema. The server can return multiple |
Beta Was this translation helpful? Give feedback.
Answered by
JacobWeisenburger
Feb 21, 2022
Replies: 1 comment
-
Unfortunately, I don't think there is a way to do that at this time. I asked a similar question awhile back: #875 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
xhw994
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, I don't think there is a way to do that at this time. I asked a similar question awhile back: #875