Skip to content

Commit dd13d14

Browse files
committed
chore: add best practice about select variant string fields having enum validaitonSchema
1 parent fd99aea commit dd13d14

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

docs/en/5-reference/5.0-form-instrument.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Always consider using \`group\`ing to structure sections
6767
8. Use [the playground](https://playground.opendatacapture.org/) to create instruments
6868
- It is updated regularly to use the latest runtime
6969
- It is setup with formatting, linting, and type checking by default
70+
9. Whenever a form field of kind 'string', and of variant 'select' is used, it is much better to have its schema be of type enum containing the possible options instead of type string ( i.e. z.enum(['string1', 'string2', ...]) instead of z.string() ).
7071

7172
### Example
7273

0 commit comments

Comments
 (0)