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
Sanity studio never sets a hotspot or crop value with only partial properties, even if it's a draft document. The schema extractor marks these as optional, which means any generated types will be too loose. This makes working with these values in typescript more complex.
Here's an example from sanity.imageHotspot. Note the added "optional": true that should not be present.
Describe the bug
Sanity studio never sets a hotspot or crop value with only partial properties, even if it's a draft document. The schema extractor marks these as optional, which means any generated types will be too loose. This makes working with these values in typescript more complex.
Here's an example from
sanity.imageHotspot
. Note the added"optional": true
that should not be present.And, for the sake of completeness, this is the type that comes out:
To Reproduce
Steps to reproduce the behavior:
sanity schema extract
to extract the schema"optional": true
is specified on all its attributesExpected behavior
This is what the correct output for the above example would be:
and this is what the corresponding correct type would be:
Which versions of Sanity are you using?
What operating system are you using?
MacOS Sequoia 15.1.1 (24B91)
Which versions of Node.js / npm are you running?
Additional context
No additional context
Security issue?
Not a security issue
The text was updated successfully, but these errors were encountered: