7
7
namespace Swaggest \JsonSchema \SwaggerSchema ;
8
8
9
9
use Swaggest \JsonSchema \Constraint \Properties ;
10
- use Swaggest \JsonSchema \Schema ;
10
+ use Swaggest \JsonSchema \Schema as JsonBasicSchema ;
11
11
use Swaggest \JsonSchema \Structure \ClassStructure ;
12
12
13
13
@@ -79,26 +79,26 @@ class FormDataParameterSubSchema extends ClassStructure {
79
79
80
80
/**
81
81
* @param Properties|static $properties
82
- * @param Schema $ownerSchema
82
+ * @param JsonBasicSchema $ownerSchema
83
83
*/
84
- public static function setUpProperties ($ properties , Schema $ ownerSchema )
84
+ public static function setUpProperties ($ properties , JsonBasicSchema $ ownerSchema )
85
85
{
86
- $ properties ->required = Schema ::boolean ();
86
+ $ properties ->required = JsonBasicSchema ::boolean ();
87
87
$ properties ->required ->description = 'Determines whether or not this parameter is required or optional. ' ;
88
88
$ properties ->required ->default = false ;
89
- $ properties ->in = Schema ::string ();
89
+ $ properties ->in = JsonBasicSchema ::string ();
90
90
$ properties ->in ->description = 'Determines the location of the parameter. ' ;
91
91
$ properties ->in ->enum = array (
92
92
0 => 'formData ' ,
93
93
);
94
- $ properties ->description = Schema ::string ();
94
+ $ properties ->description = JsonBasicSchema ::string ();
95
95
$ properties ->description ->description = 'A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. ' ;
96
- $ properties ->name = Schema ::string ();
96
+ $ properties ->name = JsonBasicSchema ::string ();
97
97
$ properties ->name ->description = 'The name of the parameter. ' ;
98
- $ properties ->allowEmptyValue = Schema ::boolean ();
98
+ $ properties ->allowEmptyValue = JsonBasicSchema ::boolean ();
99
99
$ properties ->allowEmptyValue ->description = 'allows sending a parameter by name only or with an empty value. ' ;
100
100
$ properties ->allowEmptyValue ->default = false ;
101
- $ properties ->type = Schema ::string ();
101
+ $ properties ->type = JsonBasicSchema ::string ();
102
102
$ properties ->type ->enum = array (
103
103
0 => 'string ' ,
104
104
1 => 'number ' ,
@@ -107,9 +107,9 @@ public static function setUpProperties($properties, Schema $ownerSchema)
107
107
4 => 'array ' ,
108
108
5 => 'file ' ,
109
109
);
110
- $ properties ->format = Schema ::string ();
110
+ $ properties ->format = JsonBasicSchema ::string ();
111
111
$ properties ->items = PrimitivesItems::schema ();
112
- $ properties ->collectionFormat = Schema ::string ();
112
+ $ properties ->collectionFormat = JsonBasicSchema ::string ();
113
113
$ properties ->collectionFormat ->default = 'csv ' ;
114
114
$ properties ->collectionFormat ->enum = array (
115
115
0 => 'csv ' ,
@@ -118,40 +118,40 @@ public static function setUpProperties($properties, Schema $ownerSchema)
118
118
3 => 'pipes ' ,
119
119
4 => 'multi ' ,
120
120
);
121
- $ properties ->default = new Schema ();
122
- $ properties ->maximum = Schema ::number ();
123
- $ properties ->exclusiveMaximum = Schema ::boolean ();
121
+ $ properties ->default = new JsonBasicSchema ();
122
+ $ properties ->maximum = JsonBasicSchema ::number ();
123
+ $ properties ->exclusiveMaximum = JsonBasicSchema ::boolean ();
124
124
$ properties ->exclusiveMaximum ->default = false ;
125
- $ properties ->minimum = Schema ::number ();
126
- $ properties ->exclusiveMinimum = Schema ::boolean ();
125
+ $ properties ->minimum = JsonBasicSchema ::number ();
126
+ $ properties ->exclusiveMinimum = JsonBasicSchema ::boolean ();
127
127
$ properties ->exclusiveMinimum ->default = false ;
128
- $ properties ->maxLength = Schema ::integer ();
128
+ $ properties ->maxLength = JsonBasicSchema ::integer ();
129
129
$ properties ->maxLength ->minimum = 0 ;
130
- $ properties ->minLength = new Schema ();
131
- $ properties ->minLength ->allOf [0 ] = Schema ::integer ();
130
+ $ properties ->minLength = new JsonBasicSchema ();
131
+ $ properties ->minLength ->allOf [0 ] = JsonBasicSchema ::integer ();
132
132
$ properties ->minLength ->allOf [0 ]->minimum = 0 ;
133
- $ properties ->minLength ->allOf [1 ] = new Schema ();
133
+ $ properties ->minLength ->allOf [1 ] = new JsonBasicSchema ();
134
134
$ properties ->minLength ->allOf [1 ]->default = 0 ;
135
- $ properties ->pattern = Schema ::string ();
135
+ $ properties ->pattern = JsonBasicSchema ::string ();
136
136
$ properties ->pattern ->format = 'regex ' ;
137
- $ properties ->maxItems = Schema ::integer ();
137
+ $ properties ->maxItems = JsonBasicSchema ::integer ();
138
138
$ properties ->maxItems ->minimum = 0 ;
139
- $ properties ->minItems = new Schema ();
140
- $ properties ->minItems ->allOf [0 ] = Schema ::integer ();
139
+ $ properties ->minItems = new JsonBasicSchema ();
140
+ $ properties ->minItems ->allOf [0 ] = JsonBasicSchema ::integer ();
141
141
$ properties ->minItems ->allOf [0 ]->minimum = 0 ;
142
- $ properties ->minItems ->allOf [1 ] = new Schema ();
142
+ $ properties ->minItems ->allOf [1 ] = new JsonBasicSchema ();
143
143
$ properties ->minItems ->allOf [1 ]->default = 0 ;
144
- $ properties ->uniqueItems = Schema ::boolean ();
144
+ $ properties ->uniqueItems = JsonBasicSchema ::boolean ();
145
145
$ properties ->uniqueItems ->default = false ;
146
- $ properties ->enum = Schema ::arr ();
146
+ $ properties ->enum = JsonBasicSchema ::arr ();
147
147
$ properties ->enum ->minItems = 1 ;
148
148
$ properties ->enum ->uniqueItems = true ;
149
- $ properties ->multipleOf = Schema ::number ();
149
+ $ properties ->multipleOf = JsonBasicSchema ::number ();
150
150
$ properties ->multipleOf ->minimum = 0 ;
151
151
$ properties ->multipleOf ->exclusiveMinimum = true ;
152
- $ ownerSchema = new Schema ();
152
+ $ ownerSchema = new JsonBasicSchema ();
153
153
$ ownerSchema ->additionalProperties = false ;
154
- $ ownerSchema ->patternProperties ['^x- ' ] = new Schema ();
154
+ $ ownerSchema ->patternProperties ['^x- ' ] = new JsonBasicSchema ();
155
155
$ ownerSchema ->patternProperties ['^x- ' ]->description = 'Any property starting with x- is valid. ' ;
156
156
}
157
157
}
0 commit comments