Skip to content

Commit 5f53281

Browse files
committed
chore: more info about enum types in best practices
1 parent 8005339 commit 5f53281

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ Always consider using \`group\`ing to structure sections
6868
8. Use [the playground](https://playground.opendatacapture.org/) to create instruments
6969
- It is updated regularly to use the latest runtime
7070
- It is setup with formatting, linting, and type checking by default
71+
9. Proper use of Zod's enum type
72+
- It is best to use Zod's enum type when the answer to a form question is a set of constant values.
73+
- Example: A question which asks the user to choose from a selection of options should use z.enum([option1, option2, ...]) within its zod validation schema.
7174

7275
### Example
7376

0 commit comments

Comments
 (0)