Skip to content

Commit fcd3a33

Browse files
authored
Merge pull request #283 from InfoDevkota/patch-4
fix: fix the docs about schema, global schema using guard
2 parents 734378d + b35da4b commit fcd3a33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/essential/schema.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ new Elysia()
119119
.listen(3000)
120120
```
121121

122+
This code ensures that the query must have **name** with a string value for every handler after it. The response should be listed as follows:
123+
122124
<Playground
123125
:elysia="demo2"
124126
:mock="{
@@ -140,6 +142,4 @@ The response should be listed as follows:
140142
| /query | error |
141143
| /query?name=a | a |
142144

143-
As Lifecycle Event, it is important to remember that the order of Elysia's schema is stored as same as lifecycle, a queue, or first-in-first-out.
144-
145-
Elysia **always** respects the order of code from top to bottom followed by the order of life-cycle event and validation schema.
145+
If multiple global schemas are defined for same property, the latest one will have the preference. If both local and global schemas are defined, the local one will have the preference.

0 commit comments

Comments
 (0)