Skip to content

Commit 8f1f270

Browse files
committed
swagger schema
1 parent 0a06905 commit 8f1f270

26 files changed

+410
-410
lines changed

src/SwaggerSchema/ApiKeySecurity.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Swaggest\JsonSchema\SwaggerSchema;
88

99
use Swaggest\JsonSchema\Constraint\Properties;
10-
use Swaggest\JsonSchema\Schema;
10+
use Swaggest\JsonSchema\Schema as JsonBasicSchema;
1111
use Swaggest\JsonSchema\Structure\ClassStructure;
1212

1313

@@ -26,24 +26,24 @@ class ApiKeySecurity extends ClassStructure {
2626

2727
/**
2828
* @param Properties|static $properties
29-
* @param Schema $ownerSchema
29+
* @param JsonBasicSchema $ownerSchema
3030
*/
31-
public static function setUpProperties($properties, Schema $ownerSchema)
31+
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema)
3232
{
33-
$properties->type = Schema::string();
33+
$properties->type = JsonBasicSchema::string();
3434
$properties->type->enum = array (
3535
0 => 'apiKey',
3636
);
37-
$properties->name = Schema::string();
38-
$properties->in = Schema::string();
37+
$properties->name = JsonBasicSchema::string();
38+
$properties->in = JsonBasicSchema::string();
3939
$properties->in->enum = array (
4040
0 => 'header',
4141
1 => 'query',
4242
);
43-
$properties->description = Schema::string();
43+
$properties->description = JsonBasicSchema::string();
4444
$ownerSchema->type = 'object';
4545
$ownerSchema->additionalProperties = false;
46-
$ownerSchema->patternProperties['^x-'] = new Schema();
46+
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema();
4747
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.';
4848
$ownerSchema->required = array (
4949
0 => 'type',

src/SwaggerSchema/BasicAuthenticationSecurity.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Swaggest\JsonSchema\SwaggerSchema;
88

99
use Swaggest\JsonSchema\Constraint\Properties;
10-
use Swaggest\JsonSchema\Schema;
10+
use Swaggest\JsonSchema\Schema as JsonBasicSchema;
1111
use Swaggest\JsonSchema\Structure\ClassStructure;
1212

1313

@@ -20,18 +20,18 @@ class BasicAuthenticationSecurity extends ClassStructure {
2020

2121
/**
2222
* @param Properties|static $properties
23-
* @param Schema $ownerSchema
23+
* @param JsonBasicSchema $ownerSchema
2424
*/
25-
public static function setUpProperties($properties, Schema $ownerSchema)
25+
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema)
2626
{
27-
$properties->type = Schema::string();
27+
$properties->type = JsonBasicSchema::string();
2828
$properties->type->enum = array (
2929
0 => 'basic',
3030
);
31-
$properties->description = Schema::string();
31+
$properties->description = JsonBasicSchema::string();
3232
$ownerSchema->type = 'object';
3333
$ownerSchema->additionalProperties = false;
34-
$ownerSchema->patternProperties['^x-'] = new Schema();
34+
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema();
3535
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.';
3636
$ownerSchema->required = array (
3737
0 => 'type',

src/SwaggerSchema/BodyParameter.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Swaggest\JsonSchema\SwaggerSchema;
88

99
use Swaggest\JsonSchema\Constraint\Properties;
10-
use Swaggest\JsonSchema\Schema as Schema1;
10+
use Swaggest\JsonSchema\Schema as JsonBasicSchema;
1111
use Swaggest\JsonSchema\Structure\ClassStructure;
1212

1313

@@ -29,26 +29,26 @@ class BodyParameter extends ClassStructure {
2929

3030
/**
3131
* @param Properties|static $properties
32-
* @param Schema1 $ownerSchema
32+
* @param JsonBasicSchema $ownerSchema
3333
*/
34-
public static function setUpProperties($properties, Schema1 $ownerSchema)
34+
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema)
3535
{
36-
$properties->description = Schema1::string();
36+
$properties->description = JsonBasicSchema::string();
3737
$properties->description->description = 'A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.';
38-
$properties->name = Schema1::string();
38+
$properties->name = JsonBasicSchema::string();
3939
$properties->name->description = 'The name of the parameter.';
40-
$properties->in = Schema1::string();
40+
$properties->in = JsonBasicSchema::string();
4141
$properties->in->description = 'Determines the location of the parameter.';
4242
$properties->in->enum = array (
4343
0 => 'body',
4444
);
45-
$properties->required = Schema1::boolean();
45+
$properties->required = JsonBasicSchema::boolean();
4646
$properties->required->description = 'Determines whether or not this parameter is required or optional.';
4747
$properties->required->default = false;
4848
$properties->schema = Schema::schema();
4949
$ownerSchema->type = 'object';
5050
$ownerSchema->additionalProperties = false;
51-
$ownerSchema->patternProperties['^x-'] = new Schema1();
51+
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema();
5252
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.';
5353
$ownerSchema->required = array (
5454
0 => 'name',

src/SwaggerSchema/Contact.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Swaggest\JsonSchema\SwaggerSchema;
88

99
use Swaggest\JsonSchema\Constraint\Properties;
10-
use Swaggest\JsonSchema\Schema;
10+
use Swaggest\JsonSchema\Schema as JsonBasicSchema;
1111
use Swaggest\JsonSchema\Structure\ClassStructure;
1212

1313

@@ -23,21 +23,21 @@ class Contact extends ClassStructure {
2323

2424
/**
2525
* @param Properties|static $properties
26-
* @param Schema $ownerSchema
26+
* @param JsonBasicSchema $ownerSchema
2727
*/
28-
public static function setUpProperties($properties, Schema $ownerSchema)
28+
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema)
2929
{
30-
$properties->name = Schema::string();
30+
$properties->name = JsonBasicSchema::string();
3131
$properties->name->description = 'The identifying name of the contact person/organization.';
32-
$properties->url = Schema::string();
32+
$properties->url = JsonBasicSchema::string();
3333
$properties->url->description = 'The URL pointing to the contact information.';
3434
$properties->url->format = 'uri';
35-
$properties->email = Schema::string();
35+
$properties->email = JsonBasicSchema::string();
3636
$properties->email->description = 'The email address of the contact person/organization.';
3737
$properties->email->format = 'email';
3838
$ownerSchema->type = 'object';
3939
$ownerSchema->additionalProperties = false;
40-
$ownerSchema->patternProperties['^x-'] = new Schema();
40+
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema();
4141
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.';
4242
$ownerSchema->description = 'Contact information for the owners of the API.';
4343
}

src/SwaggerSchema/ExternalDocs.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Swaggest\JsonSchema\SwaggerSchema;
88

99
use Swaggest\JsonSchema\Constraint\Properties;
10-
use Swaggest\JsonSchema\Schema;
10+
use Swaggest\JsonSchema\Schema as JsonBasicSchema;
1111
use Swaggest\JsonSchema\Structure\ClassStructure;
1212

1313

@@ -20,16 +20,16 @@ class ExternalDocs extends ClassStructure {
2020

2121
/**
2222
* @param Properties|static $properties
23-
* @param Schema $ownerSchema
23+
* @param JsonBasicSchema $ownerSchema
2424
*/
25-
public static function setUpProperties($properties, Schema $ownerSchema)
25+
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema)
2626
{
27-
$properties->description = Schema::string();
28-
$properties->url = Schema::string();
27+
$properties->description = JsonBasicSchema::string();
28+
$properties->url = JsonBasicSchema::string();
2929
$properties->url->format = 'uri';
3030
$ownerSchema->type = 'object';
3131
$ownerSchema->additionalProperties = false;
32-
$ownerSchema->patternProperties['^x-'] = new Schema();
32+
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema();
3333
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.';
3434
$ownerSchema->description = 'information about external documentation';
3535
$ownerSchema->required = array (

src/SwaggerSchema/FileSchema.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Swaggest\JsonSchema\SwaggerSchema;
88

99
use Swaggest\JsonSchema\Constraint\Properties;
10-
use Swaggest\JsonSchema\Schema;
10+
use Swaggest\JsonSchema\Schema as JsonBasicSchema;
1111
use Swaggest\JsonSchema\Structure\ClassStructure;
1212

1313

@@ -39,29 +39,29 @@ class FileSchema extends ClassStructure {
3939

4040
/**
4141
* @param Properties|static $properties
42-
* @param Schema $ownerSchema
42+
* @param JsonBasicSchema $ownerSchema
4343
*/
44-
public static function setUpProperties($properties, Schema $ownerSchema)
44+
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema)
4545
{
46-
$properties->format = Schema::string();
47-
$properties->title = Schema::string();
48-
$properties->description = Schema::string();
49-
$properties->default = new Schema();
50-
$properties->required = Schema::arr();
51-
$properties->required->items = Schema::string();
46+
$properties->format = JsonBasicSchema::string();
47+
$properties->title = JsonBasicSchema::string();
48+
$properties->description = JsonBasicSchema::string();
49+
$properties->default = new JsonBasicSchema();
50+
$properties->required = JsonBasicSchema::arr();
51+
$properties->required->items = JsonBasicSchema::string();
5252
$properties->required->minItems = 1;
5353
$properties->required->uniqueItems = true;
54-
$properties->type = Schema::string();
54+
$properties->type = JsonBasicSchema::string();
5555
$properties->type->enum = array (
5656
0 => 'file',
5757
);
58-
$properties->readOnly = Schema::boolean();
58+
$properties->readOnly = JsonBasicSchema::boolean();
5959
$properties->readOnly->default = false;
6060
$properties->externalDocs = ExternalDocs::schema();
61-
$properties->example = new Schema();
61+
$properties->example = new JsonBasicSchema();
6262
$ownerSchema->type = 'object';
6363
$ownerSchema->additionalProperties = false;
64-
$ownerSchema->patternProperties['^x-'] = new Schema();
64+
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema();
6565
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.';
6666
$ownerSchema->description = 'A deterministic version of a JSON Schema object.';
6767
$ownerSchema->required = array (

src/SwaggerSchema/FormDataParameterSubSchema.php

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Swaggest\JsonSchema\SwaggerSchema;
88

99
use Swaggest\JsonSchema\Constraint\Properties;
10-
use Swaggest\JsonSchema\Schema;
10+
use Swaggest\JsonSchema\Schema as JsonBasicSchema;
1111
use Swaggest\JsonSchema\Structure\ClassStructure;
1212

1313

@@ -79,26 +79,26 @@ class FormDataParameterSubSchema extends ClassStructure {
7979

8080
/**
8181
* @param Properties|static $properties
82-
* @param Schema $ownerSchema
82+
* @param JsonBasicSchema $ownerSchema
8383
*/
84-
public static function setUpProperties($properties, Schema $ownerSchema)
84+
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema)
8585
{
86-
$properties->required = Schema::boolean();
86+
$properties->required = JsonBasicSchema::boolean();
8787
$properties->required->description = 'Determines whether or not this parameter is required or optional.';
8888
$properties->required->default = false;
89-
$properties->in = Schema::string();
89+
$properties->in = JsonBasicSchema::string();
9090
$properties->in->description = 'Determines the location of the parameter.';
9191
$properties->in->enum = array (
9292
0 => 'formData',
9393
);
94-
$properties->description = Schema::string();
94+
$properties->description = JsonBasicSchema::string();
9595
$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();
9797
$properties->name->description = 'The name of the parameter.';
98-
$properties->allowEmptyValue = Schema::boolean();
98+
$properties->allowEmptyValue = JsonBasicSchema::boolean();
9999
$properties->allowEmptyValue->description = 'allows sending a parameter by name only or with an empty value.';
100100
$properties->allowEmptyValue->default = false;
101-
$properties->type = Schema::string();
101+
$properties->type = JsonBasicSchema::string();
102102
$properties->type->enum = array (
103103
0 => 'string',
104104
1 => 'number',
@@ -107,9 +107,9 @@ public static function setUpProperties($properties, Schema $ownerSchema)
107107
4 => 'array',
108108
5 => 'file',
109109
);
110-
$properties->format = Schema::string();
110+
$properties->format = JsonBasicSchema::string();
111111
$properties->items = PrimitivesItems::schema();
112-
$properties->collectionFormat = Schema::string();
112+
$properties->collectionFormat = JsonBasicSchema::string();
113113
$properties->collectionFormat->default = 'csv';
114114
$properties->collectionFormat->enum = array (
115115
0 => 'csv',
@@ -118,40 +118,40 @@ public static function setUpProperties($properties, Schema $ownerSchema)
118118
3 => 'pipes',
119119
4 => 'multi',
120120
);
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();
124124
$properties->exclusiveMaximum->default = false;
125-
$properties->minimum = Schema::number();
126-
$properties->exclusiveMinimum = Schema::boolean();
125+
$properties->minimum = JsonBasicSchema::number();
126+
$properties->exclusiveMinimum = JsonBasicSchema::boolean();
127127
$properties->exclusiveMinimum->default = false;
128-
$properties->maxLength = Schema::integer();
128+
$properties->maxLength = JsonBasicSchema::integer();
129129
$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();
132132
$properties->minLength->allOf[0]->minimum = 0;
133-
$properties->minLength->allOf[1] = new Schema();
133+
$properties->minLength->allOf[1] = new JsonBasicSchema();
134134
$properties->minLength->allOf[1]->default = 0;
135-
$properties->pattern = Schema::string();
135+
$properties->pattern = JsonBasicSchema::string();
136136
$properties->pattern->format = 'regex';
137-
$properties->maxItems = Schema::integer();
137+
$properties->maxItems = JsonBasicSchema::integer();
138138
$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();
141141
$properties->minItems->allOf[0]->minimum = 0;
142-
$properties->minItems->allOf[1] = new Schema();
142+
$properties->minItems->allOf[1] = new JsonBasicSchema();
143143
$properties->minItems->allOf[1]->default = 0;
144-
$properties->uniqueItems = Schema::boolean();
144+
$properties->uniqueItems = JsonBasicSchema::boolean();
145145
$properties->uniqueItems->default = false;
146-
$properties->enum = Schema::arr();
146+
$properties->enum = JsonBasicSchema::arr();
147147
$properties->enum->minItems = 1;
148148
$properties->enum->uniqueItems = true;
149-
$properties->multipleOf = Schema::number();
149+
$properties->multipleOf = JsonBasicSchema::number();
150150
$properties->multipleOf->minimum = 0;
151151
$properties->multipleOf->exclusiveMinimum = true;
152-
$ownerSchema = new Schema();
152+
$ownerSchema = new JsonBasicSchema();
153153
$ownerSchema->additionalProperties = false;
154-
$ownerSchema->patternProperties['^x-'] = new Schema();
154+
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema();
155155
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.';
156156
}
157157
}

0 commit comments

Comments
 (0)