-
-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Labels
bug 🔥Something isn't workingSomething isn't workingneeds info ⏳Further information is requiredFurther information is required
Description
Description
Make an openapi spec for a schema with arbitrary keys (`"additionalProperties": true) and generate types + zod models for it using hey-api.
The type will be correct:
export type MyModel = {
id: string;
[key: string]: unknown | string; // Hooray, it worked!
};
But the zod schema won't look for these extra properties and will instead strip them during parse
:
export const zMyModel = z.object({
id: z.string()
}); // no .catchall(...) :(
Reproducible example or configuration
(Seems like a bunch of work to mangle stackblitz into a MWE -- hopefully the bug report contains sufficient info)
OpenAPI specification (optional)
No response
System information (optional)
No response
kentkweemrlubos
Metadata
Metadata
Assignees
Labels
bug 🔥Something isn't workingSomething isn't workingneeds info ⏳Further information is requiredFurther information is required