Schema.Array and optional fields
Use Schema.Array(schema) for arrays of validated items. Combine with Schema.optional and Schema.default for flexible request/response shapes.
- Schema.Array(itemSchema) validates each element
- Schema.default(value) provides a value when input is undefined
- Combine optional + default for "optional with fallback"
Loading code editor...