-
Notifications
You must be signed in to change notification settings - Fork 932
/
OpenApiSpec.php
110 lines (103 loc) · 2.37 KB
/
OpenApiSpec.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* @license Apache 2.0
*/
namespace OpenApi\Examples\Misc;
use OpenApi\Annotations as OA;
/**
* @OA\OpenApi(
* security={{"bearerAuth": {}}},
* @OA\Tag(
* name="endpoints"
* )
* )
* @OA\Info(
* title="Testing annotations from bugreports",
* version="1.0.0",
* description="NOTE:
This sentence is on a new line",
* @OA\Contact(name="Swagger API Team")
* )
* @OA\Components(
* @OA\SecurityScheme(
* securityScheme="bearerAuth",
* type="http",
* scheme="bearer",
* ),
* @OA\Attachable
* )
* @OA\Server(
* url="{schema}://host.dev",
* description="OpenApi parameters",
* @OA\ServerVariable(
* serverVariable="schema",
* enum={"https", "http"},
* default="https"
* )
* )
*/
class OpenApiSpec
{
}
/**
* An API endpoint.
*
* @OA\Get(
* path="/api/endpoint",
* description="An endpoint",
* operationId="endpoint",
* tags={"endpoints"},
* @OA\Parameter(name="filter", in="query", @OA\JsonContent(
* @OA\Property(property="type", type="string"),
* @OA\Property(property="color", type="string"),
* )),
* security={{ "bearerAuth": {} }},
* @OA\Response(response="200", ref="#/components/responses/200")
* )
*/
class Endpoint
{
}
/**
* @OA\Response(
* response=200,
* description="Success",
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(property="name", type="integer", description="demo")
* ),
* @OA\Examples(example=200, summary="", value={"name": 1}),
* @OA\Examples(example=300, summary="", value={"name": 1}),
* @OA\Examples(example=400, summary="", value={"name": 1})
* )
* )
*/
class Response
{
}
/**
* Another API endpoint.
*
* @OA\Get(
* path="/api/anotherendpoint",
* description="Another endpoint",
* operationId="anotherendpoints",
* tags={"endpoints"},
* @OA\Parameter(
* name="things[]",
* in="query",
* description="A list of things.",
* required=false,
* @OA\Schema(
* type="array",
* @OA\Items(type="integer")
* )
* ),
* security={{ "bearerAuth": {} }},
* @OA\Response(response="200", ref="#/components/responses/200")
* )
*/
class MultiValueQueryParam
{
}