1
|
|
|
<?php |
2
|
|
|
namespace PhpBoot\Docgen\Swagger\Schemas; |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* Class Swagger |
6
|
|
|
* @package PhpBoot\Docgen |
7
|
|
|
*/ |
8
|
|
|
class SwaggerObject |
9
|
|
|
{ |
10
|
1 |
|
public function __construct() |
11
|
|
|
{ |
12
|
1 |
|
$this->info = new InfoObject(); |
13
|
1 |
|
} |
14
|
|
|
/** |
15
|
|
|
* Required. |
16
|
|
|
* Specifies the Swagger Specification version being used. |
17
|
|
|
* It can be used by the Swagger UI and other clients to interpret the API listing. |
18
|
|
|
* The value MUST be "2.0". |
19
|
|
|
* @var string |
20
|
|
|
*/ |
21
|
|
|
public $swagger = '2.0'; |
22
|
|
|
/** |
23
|
|
|
* Required. |
24
|
|
|
* Provides metadata about the API. The metadata can be used by the clients if needed. |
25
|
|
|
* @var InfoObject |
26
|
|
|
*/ |
27
|
|
|
public $info; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port). The host does not support path templating. |
31
|
|
|
* @var string |
32
|
|
|
*/ |
33
|
|
|
public $host = 'localhost'; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* The base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). The basePath does not support path templating. |
37
|
|
|
* @var string |
38
|
|
|
*/ |
39
|
|
|
public $basePath = '/'; |
40
|
|
|
/** |
41
|
|
|
* The transfer protocol of the API. Values MUST be from the list: "http", "https", "ws", "wss". If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself. |
42
|
|
|
* @var string[] |
43
|
|
|
*/ |
44
|
|
|
public $schemes = ['http']; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under Mime Types. |
48
|
|
|
* @var string[] |
49
|
|
|
*/ |
50
|
|
|
public $consumes = ['application/json']; |
51
|
|
|
/** |
52
|
|
|
* A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under Mime Types. |
53
|
|
|
* @var string[] |
54
|
|
|
*/ |
55
|
|
|
public $produces= ['application/json']; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var PathItemObject[] |
59
|
|
|
*/ |
60
|
|
|
public $paths=[]; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* An object to hold data types produced and consumed by operations. |
64
|
|
|
* @var RefSchemaObject[]|SimpleModelSchemaObject[]|PrimitiveSchemaObject[]|ArraySchemaObject[] |
65
|
|
|
*/ |
66
|
|
|
public $definitions=[]; |
67
|
|
|
/** |
68
|
|
|
* An object to hold parameters that can be used across operations. This property does not define global |
69
|
|
|
* parameters for all operations. |
70
|
|
|
* @var ParameterObject[]|OtherParameterObject[] |
71
|
|
|
*/ |
72
|
|
|
public $parameters; |
73
|
|
|
/** |
74
|
|
|
* An object to hold responses that can be used across operations. This property does not define global responses for all operations. |
75
|
|
|
* @var ResponseObject[] |
76
|
|
|
*/ |
77
|
|
|
public $responses; |
78
|
|
|
/** |
79
|
|
|
* Security scheme definitions that can be used across the specification. |
80
|
|
|
* @var SecuritySchemeObject |
81
|
|
|
*/ |
82
|
|
|
public $securityDefinitions; |
83
|
|
|
/** |
84
|
|
|
* A declaration of which security schemes are applied for the API as a whole. The list of values |
85
|
|
|
* describes alternative security schemes that can be used (that is, there is a logical OR between the |
86
|
|
|
* security requirements). Individual operations can override this definition. |
87
|
|
|
* @var SecurityRequirementObject |
88
|
|
|
*/ |
89
|
|
|
public $security; |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* A list of tags used by the specification with additional metadata. The order of the tags can be used |
93
|
|
|
* to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object |
94
|
|
|
* must be declared. The tags that are not declared may be organized randomly or based on the tools' |
95
|
|
|
* logic. Each tag name in the list MUST be unique. |
96
|
|
|
* @var TagObject[] |
97
|
|
|
*/ |
98
|
|
|
public $tags; |
99
|
|
|
/** |
100
|
|
|
* @var ExternalDocumentationObject |
101
|
|
|
*/ |
102
|
|
|
public $externalDocs; |
103
|
|
|
|
104
|
|
|
} |