File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,9 @@ routes:
187187
188188# ## Request Handling
189189
190- Create request DTO definitions for validation :
190+ Create request DTO definitions for validation. You can define DTOs inline or reference external DTO files :
191+
192+ **Inline DTO Definition:**
191193
192194` ` ` yaml
193195# config/requests/user_profile.yaml
@@ -201,6 +203,29 @@ request:
201203 min: 1
202204` ` `
203205
206+ **Referenced DTO:**
207+
208+ ` ` ` yaml
209+ # config/requests/user_create.yaml
210+ request:
211+ method: POST
212+ dto: user # References config/Dtos/user.yaml or src/Dtos/user.yaml
213+ ` ` `
214+
215+ ` ` ` yaml
216+ # config/Dtos/user.yaml (or src/Dtos/user.yaml)
217+ dto:
218+ username:
219+ type: string
220+ required: true
221+ length:
222+ min: 3
223+ max: 20
224+ email:
225+ type: email
226+ required: true
227+ ` ` `
228+
204229Access validated data in controllers :
205230
206231` ` ` php
You can’t perform that action at this time.
0 commit comments