Omit is still parsing values
If I omit a field from a schema like so and the date_created is passed in, it will be validated.
I expected omit to ignore / drop the field from the dataset when parsing:
linkApi.schema.link.omit("date_created", "date_updated")
Is this correct and is there any way to ignore/remove fields that are not on the schema when parsing a piece of data?
If i pass {name: "John", email: "[email protected]"}
and my schema is omitting "email".. i would expect the parsed data to only have "name".1 Reply
Check out the docs for undeclared key handling:
https://arktype.io/docs/objects#properties-undeclared
ArkType Docs
Optimized runtime validation for TypeScript syntax