Schema and Optional Properties with Defaults
How can I express in effect schema that if all object properties are optional, the object itself should be optional?
Here's an example zod schema:
Since both
This is what schema forces me to do. Is there a way describe this behavior like in zod?
Here's an example zod schema:
Since both
a and b are optional, zod allows me to set the default value for options to {}, but somehow I can't do that with schema.This is what schema forces me to do. Is there a way describe this behavior like in zod?
