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
If I define a string field with a list of predefined values, TypeGen generates a union type for that field. However, if I define an array field with a list of predefined values (to get checkboxes in the studio), TypeGen just generates Array<string> as the type of that field.
To Reproduce
Steps to reproduce the behavior:
Create a project (opting in to TypeScript) or edit an existing one, and make a sanity.config.ts that's something like this:
Describe the bug
If I define a string field with a list of predefined values, TypeGen generates a union type for that field. However, if I define an array field with a list of predefined values (to get checkboxes in the studio), TypeGen just generates
Array<string>
as the type of that field.To Reproduce
Steps to reproduce the behavior:
npx sanity schema extract && npx sanity typegen generate
and observe the generated types (e.g. sanity.types.ts)Expected behavior
Actual behavior
Which versions of Sanity are you using?
What operating system are you using?
GNU/Linux (Ubuntu 22.04.4 LTS)
Which versions of Node.js / npm are you running?
npm -v && node -v
:10.2.4
v20.11.1
The text was updated successfully, but these errors were encountered: