You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, when creating a typed JSON field, every possible field needs to be specified, otherwise Validation error: Unrecognized key(s) in object. will be thrown.
Describe the solution you'd like
This makes incremental typing impossible, where some fields would be typed, but any other field would still be accepted.
So I'd like to propose a flag that loosens the Zod type check so that setting the typed JSON column is possible with a partially typed value, where all specified properties must be valid, but further unspecified properties are accepted.
Describe alternatives you've considered
Since this is a schema feature, I don't think there's a simple workaround. I had to spend a fair bit of time migrating a big metadata field that is currently used as a bit of dumping ground until we figure out what's exactly needed.
Additional context
I also had to leave some deeper properties as untyped JSON to prevent further issues, even though I do know what are some of the expected properties.
The text was updated successfully, but these errors were encountered:
daaain
changed the title
Partially typed JSON fields
[Feature Request] Partially typed JSON fields
Apr 29, 2025
Is your feature request related to a problem? Please describe.
Currently, when creating a typed JSON field, every possible field needs to be specified, otherwise
Validation error: Unrecognized key(s) in object.
will be thrown.Describe the solution you'd like
This makes incremental typing impossible, where some fields would be typed, but any other field would still be accepted.
So I'd like to propose a flag that loosens the Zod type check so that setting the typed JSON column is possible with a partially typed value, where all specified properties must be valid, but further unspecified properties are accepted.
Describe alternatives you've considered
Since this is a schema feature, I don't think there's a simple workaround. I had to spend a fair bit of time migrating a big metadata field that is currently used as a bit of dumping ground until we figure out what's exactly needed.
Additional context
I also had to leave some deeper properties as untyped JSON to prevent further issues, even though I do know what are some of the expected properties.
The text was updated successfully, but these errors were encountered: