@@ -95,6 +95,11 @@ public function typeToArrayCases()
9595 'is_admin ' => ['type ' => 'boolean ' ],
9696 'file ' => ['type ' => 'string ' , 'format ' => 'binary ' ,],
9797 'nullable_field ' => ['type ' => ['string ' , 'null ' ]],
98+ 'date ' => [
99+ 'type ' => ['string ' , 'null ' ],
100+ 'format ' => 'date ' ,
101+ 'pattern ' => '^\d{4}-\d{2}-\d{2}$ '
102+ ],
98103 ],
99104 'required ' => ['id ' , 'file ' ],
100105 ],
@@ -106,6 +111,12 @@ public function typeToArrayCases()
106111 'is_admin ' => ['type ' => 'boolean ' ],
107112 'file ' => ['type ' => 'string ' , 'format ' => 'binary ' ,],
108113 'nullable_field ' => ['type ' => 'string ' , 'nullable ' => true ],
114+ 'date ' => [
115+ 'type ' => 'string ' ,
116+ 'format ' => 'date ' ,
117+ 'nullable ' => true ,
118+ 'pattern ' => '^\d{4}-\d{2}-\d{2}$ ' ,
119+ ],
109120 ],
110121 'required ' => ['id ' , 'file ' ],
111122 ],
@@ -222,6 +233,11 @@ public function typeToArrayCases()
222233 'is_admin ' => ['type ' => 'boolean ' ],
223234 'file ' => ['type ' => 'string ' , 'format ' => 'binary ' ,],
224235 'nullable_field ' => ['type ' => ['string ' , 'null ' ]],
236+ 'date ' => [
237+ 'type ' => ['string ' , 'null ' ],
238+ 'format ' => 'date ' ,
239+ 'pattern ' => '^\d{4}-\d{2}-\d{2}$ '
240+ ],
225241 ],
226242 'required ' => ['id ' , 'file ' ],
227243
@@ -258,6 +274,12 @@ public function typeToArrayCases()
258274 'is_admin ' => ['type ' => 'boolean ' ],
259275 'file ' => ['type ' => 'string ' , 'format ' => 'binary ' ,],
260276 'nullable_field ' => ['type ' => 'string ' , 'nullable ' => true ],
277+ 'date ' => [
278+ 'type ' => 'string ' ,
279+ 'format ' => 'date ' ,
280+ 'nullable ' => true ,
281+ 'pattern ' => '^\d{4}-\d{2}-\d{2}$ ' ,
282+ ],
261283 ],
262284 'required ' => ['id ' , 'file ' ],
263285
@@ -299,6 +321,11 @@ public function typeToArrayCases()
299321 'is_admin ' => ['type ' => 'boolean ' ],
300322 'file ' => ['type ' => 'string ' , 'format ' => 'binary ' ,],
301323 'nullable_field ' => ['type ' => ['string ' , 'null ' ]],
324+ 'date ' => [
325+ 'type ' => ['string ' , 'null ' ],
326+ 'format ' => 'date ' ,
327+ 'pattern ' => '^\d{4}-\d{2}-\d{2}$ ' ,
328+ ],
302329 ],
303330 'required ' => ['id ' , 'file ' ],
304331
@@ -342,6 +369,12 @@ public function typeToArrayCases()
342369 'is_admin ' => ['type ' => 'boolean ' ],
343370 'file ' => ['type ' => 'string ' , 'format ' => 'binary ' ],
344371 'nullable_field ' => ['type ' => 'string ' , 'nullable ' => true ],
372+ 'date ' => [
373+ 'type ' => 'string ' ,
374+ 'format ' => 'date ' ,
375+ 'nullable ' => true ,
376+ 'pattern ' => '^\d{4}-\d{2}-\d{2}$ ' ,
377+ ],
345378 ],
346379 'required ' => ['id ' , 'file ' ],
347380
@@ -443,6 +476,11 @@ public function typeToArrayCases()
443476 'nullable_field ' => [
444477 'type ' => ['string ' , 'null ' ],
445478 ],
479+ 'date ' => [
480+ 'type ' => ['string ' , 'null ' ],
481+ 'format ' => 'date ' ,
482+ 'pattern ' => '^\d{4}-\d{2}-\d{2}$ '
483+ ],
446484 ],
447485 'required ' => ['id ' , 'file ' ],
448486 ],
@@ -469,6 +507,12 @@ public function typeToArrayCases()
469507 'type ' => 'string ' ,
470508 'nullable ' => true ,
471509 ],
510+ 'date ' => [
511+ 'type ' => 'string ' ,
512+ 'format ' => 'date ' ,
513+ 'nullable ' => true ,
514+ 'pattern ' => '^\d{4}-\d{2}-\d{2}$ ' ,
515+ ],
472516 ],
473517 'required ' => ['id ' , 'file ' ],
474518 ],
@@ -731,6 +775,7 @@ class Product001Type extends ProductType
731775 public static $ is_admin = 'boolean ' ;
732776 public static $ file = '!binary ' ;
733777 public static $ nullable_field = 'string? ' ;
778+ public static $ date = 'date? ' ;
734779}
735780
736781/**
0 commit comments