Skip to content

Commit 3223ca3

Browse files
authored
Merge pull request #295 from m1212e/patch-2
Update schema-type.md
2 parents 809b6f7 + e71cb57 commit 3223ca3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/validation/schema-type.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,15 @@ The validation should be as follows:
331331
| 1 | 400 ||
332332
| `false` | 200 ||
333333
| `false` | 400 ||
334+
335+
## Constructor
336+
You can use the Elysia constructor to set the behavior for unknown fields on outgoing and incoming bodies via the `normalize` option. By default, elysia will raise an error in case a request or response contains fields which are not explicitly allowed in the schema of the respective handler.
337+
You can change this by setting `normalize` to true when constructing your elysia instance.
338+
339+
```ts twoslash
340+
import { Elysia, t } from 'elysia'
341+
342+
new Elysia({
343+
normalize: true
344+
})
345+
```

0 commit comments

Comments
 (0)