feat(experimental): allow null when schema is optional - #200
Conversation
optional already meant undefined may pass; treat null the same so callers and handlers share one nullish absence model.
commit: |
|
| : I extends TypeDefination<infer T, any, infer D> | ||
| ? undefined extends D | ||
| ? T | null | ||
| : T |
There was a problem hiding this comment.
Defaulted inputs still reject null
When an optional schema declares a default, runtime validation accepts null and substitutes that default, but InferArgs and FieldIn still exclude null because D is concrete. Typed direct calls and object fields therefore reject inputs that the new runtime contract deliberately accepts.
Knowledge Base Used: Validation and schema contracts
optional already meant undefined may pass; treat null the same so callers and handlers share one nullish absence model.