/
openapisample.json
151 lines (151 loc) · 4.54 KB
/
openapisample.json
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
"openapi": "3.0.2",
"info": {
"title": "Swagger Petstore Demo",
"description": "This is a sample documentation for Petstore.",
"termsOfService": "https://swagger.io/terms",
"contact": {
"name": "API team",
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/License-2.0.html"
},
"version": "1.0.15"
},
"servers": [
{
"url": "https://petstore3.swagger.io/api/v3",
"description": "The production servers"
}
],
"tags": [
{
"name": "Pet",
"description": "All the details about pet"
},
{
"name": "Store",
"description": "Information about orders"
},
{
"name": "User",
"description": "Operations about user"
}
],
"security": [
{
"api_key": [],
"petstore_auth": [
"write:pets",
"read:pets"
]
}
],
"paths": {
"/pet": {
"post": {
"tags": [
"Pet"
],
"description": "Add a new pet to the Petstore",
"summary": "Add a new pet to the Petstore",
"requestBody": {
"description": "The information about the properties in Request body",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
},
"responses": {
"200": {
"description": "Successful Operations",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
},
"405": {
"description": "Invalid Content"
}
},
"security": [
{
"api_key": [],
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}
}
},
"components": {
"schemas": {
"Pet": {
"required": [
"id",
"photourl"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"description": "The ID of the pet",
"example": 10
},
"name": {
"type": "string",
"description": "The name of the pet",
"example": "Doggo"
},
"photourl": {
"type": "string",
"description": "The URL to the pet's photourl",
"example": "sample.url/doggo.jpg"
}
}
}
},
"requestBodies": {
"Pet": {
"description": "The details of the request body",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
}
},
"securitySchemes": {
"petstore_auth": {
"type": "oauth2",
"flows": {
"implicit": {
"authorizationUrl": "https://petstore3.swagger.io/oauth/authorize",
"scopes": {
"write:pets": "modify the pet information",
"read:pets": "read the pet information"
}
}
}
},
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "header"
}
}
}
}