@@ -19,6 +19,7 @@ class AnnotationParameterData
19
19
public ?string $ example ;
20
20
public ?string $ nestedArraySwaggerType ;
21
21
public ?array $ nestedObjectParameterData ;
22
+ public ?ParameterConstraints $ constraints ;
22
23
23
24
public function __construct (
24
25
string $ swaggerType ,
@@ -27,9 +28,10 @@ public function __construct(
27
28
string $ location ,
28
29
bool $ required ,
29
30
bool $ nullable ,
30
- string $ example = null ,
31
- string $ nestedArraySwaggerType = null ,
31
+ ? string $ example = null ,
32
+ ? string $ nestedArraySwaggerType = null ,
32
33
?array $ nestedObjectParameterData = null ,
34
+ ?ParameterConstraints $ constraints = null ,
33
35
) {
34
36
$ this ->swaggerType = $ swaggerType ;
35
37
$ this ->name = $ name ;
@@ -40,10 +42,12 @@ public function __construct(
40
42
$ this ->example = $ example ;
41
43
$ this ->nestedArraySwaggerType = $ nestedArraySwaggerType ;
42
44
$ this ->nestedObjectParameterData = $ nestedObjectParameterData ;
45
+ $ this ->constraints = $ constraints ;
43
46
}
44
47
45
48
private function addArrayItemsIfArray (ParenthesesBuilder $ container )
46
49
{
50
+ ///TODO: nested constraints should be added here
47
51
if ($ this ->swaggerType !== "array " ) {
48
52
return ;
49
53
}
@@ -128,6 +132,9 @@ public function toPropertyAnnotation(): string
128
132
$ body ->addKeyValue ("description " , $ this ->description );
129
133
}
130
134
135
+ // handle param constraints
136
+ $ this ->constraints ?->addConstraints($ body );
137
+
131
138
// handle arrays
132
139
$ this ->addArrayItemsIfArray ($ body );
133
140
0 commit comments