Open thoughtspile opened 1 year ago
When using TS-first collection schemas, the field validations can be stricter than the type passed:
array<string>(enums(['s'])) array<{ key: string }>(object({ key: string(), extra: string() })) object<{ key: string }>({ key: enums(['s']) })
This never results in incorrect runtime values, but can make authoring and maintaining schemas a bit more daunting and cause false negatives. In the case of nested objects, I'm pretty sure there's no way to disallow extra keys with current TS.
I'm not sure how to tackle this one if you have an idea let me know and i'll try to help implement it =)
I have no ideas either. At this point it's probably best to add a note about nested objects in the docs
When using TS-first collection schemas, the field validations can be stricter than the type passed:
This never results in incorrect runtime values, but can make authoring and maintaining schemas a bit more daunting and cause false negatives. In the case of nested objects, I'm pretty sure there's no way to disallow extra keys with current TS.