Skip to content

Commit 13eb200

Browse files
committed
fix openapiv3
1 parent 7cf126c commit 13eb200

File tree

14 files changed

+991
-500
lines changed

14 files changed

+991
-500
lines changed

documents/forOpenAPISpecification/OpenAPI_Specification_3.0.3.md

Lines changed: 431 additions & 482 deletions
Large diffs are not rendered by default.

documents/forOpenAPISpecification/reference/DB_OpenAPI_Mapping_Example.md

Lines changed: 0 additions & 18 deletions
This file was deleted.
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
type: object
2+
required:
3+
- code
4+
- message
5+
properties:
6+
code:
7+
type: integer
8+
format: int32
9+
message:
10+
type: string
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
type: object
2+
required:
3+
- id
4+
- name
5+
- category
6+
- age
7+
- sex
8+
properties:
9+
id:
10+
type: integer
11+
format: int64
12+
name:
13+
type: string
14+
maxLength: 50
15+
category:
16+
type: string
17+
maxLength: 10
18+
sub_category:
19+
type: string
20+
maxLength: 50
21+
age:
22+
type: integer
23+
format: int32
24+
sex:
25+
type: string
26+
maxLength: 6
27+
note:
28+
type: string
29+
maxLength: 200
30+
tag:
31+
type: string
32+
maxLength: 20
Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
openapi: 3.0.3
2+
info:
3+
version: 1.0.0
4+
title: Swagger Petstore
5+
license:
6+
name: MIT
7+
servers:
8+
- url: 'http://petstore.swagger.io/v1'
9+
tags:
10+
- name: pets
11+
description: Everything about your Pets
12+
paths:
13+
/pets:
14+
get:
15+
summary: List all pets
16+
operationId: get-pets
17+
tags:
18+
- pets
19+
parameters:
20+
- name: limit
21+
in: query
22+
description: How many items to return at one time (max 100)
23+
required: false
24+
schema:
25+
type: integer
26+
maximum: 100
27+
format: int32
28+
responses:
29+
'200':
30+
description: A paged array of pets
31+
headers:
32+
x-next:
33+
description: A link to the next page of responses
34+
schema:
35+
type: string
36+
content:
37+
application/json:
38+
schema:
39+
type: array
40+
maxItems: 100
41+
items:
42+
$ref: '#/components/schemas/Pet'
43+
examples:
44+
ResExample1:
45+
value:
46+
- id: 10001
47+
name: ToyPoodle
48+
category: dog
49+
sub_category: ToyPoodle
50+
age: 1
51+
sex: male
52+
note: friendly
53+
tag: dog10001
54+
- id: 10002
55+
name: Chihuahua
56+
category: dog
57+
sub_category: Chihuahua
58+
age: 1
59+
sex: female
60+
note: friendly
61+
tag: dog10002
62+
- id: 10003
63+
name: Shiba
64+
category: dog
65+
sub_category: Shiba
66+
age: 1
67+
sex: male
68+
note: friendly
69+
tag: dog10003
70+
- id: 10004
71+
name: MiniatureDachshund
72+
category: dog
73+
sub_category: MiniatureDachshund
74+
age: 1
75+
sex: female
76+
note: friendly
77+
tag: dog10004
78+
ResExample2:
79+
value: []
80+
'404':
81+
description: not found error
82+
content:
83+
application/json:
84+
schema:
85+
$ref: '#/components/schemas/Error'
86+
'500':
87+
description: unexpected error
88+
content:
89+
application/json:
90+
schema:
91+
$ref: '#/components/schemas/Error'
92+
post:
93+
summary: Register a pet
94+
operationId: post-pets
95+
tags:
96+
- pets
97+
requestBody:
98+
content:
99+
application/json:
100+
schema:
101+
required:
102+
- pet
103+
type: object
104+
properties:
105+
pet:
106+
$ref: '#/components/schemas/Pet'
107+
examples:
108+
ReqExample1:
109+
value:
110+
pet:
111+
id: 10005
112+
name: FrenchBulldog
113+
category: dog
114+
sub_category: FrenchBulldog
115+
age: 1
116+
sex: male
117+
note: friendly
118+
tag: dog10005
119+
required: false
120+
responses:
121+
'201':
122+
description: Null response
123+
'404':
124+
description: not found error
125+
content:
126+
application/json:
127+
schema:
128+
$ref: '#/components/schemas/Error'
129+
'500':
130+
description: unexpected error
131+
content:
132+
application/json:
133+
schema:
134+
$ref: '#/components/schemas/Error'
135+
'/pets/{petId}':
136+
get:
137+
summary: Details for a pet
138+
operationId: get-pets-pet-id
139+
tags:
140+
- pets
141+
parameters:
142+
- name: petId
143+
in: path
144+
required: true
145+
description: The id of the pet to retrieve
146+
schema:
147+
type: string
148+
responses:
149+
'200':
150+
description: Expected response to a valid request
151+
content:
152+
application/json:
153+
schema:
154+
required:
155+
- pet
156+
- pet_detail
157+
type: object
158+
properties:
159+
pet:
160+
$ref: '#/components/schemas/Pet'
161+
pet_detail:
162+
$ref: '#/components/schemas/PetDetail'
163+
examples:
164+
ResExample1:
165+
value:
166+
pet:
167+
id: 10001
168+
name: ToyPoodle
169+
category: dog
170+
sub_category: ToyPoodle
171+
age: 1
172+
sex: male
173+
note: friendly
174+
tag: dog10001
175+
pet_detail:
176+
breeder: BreederName
177+
date_of_birth: '2023-10-31'
178+
pedigree:
179+
registration_no: 11111111
180+
date_of_registration: '2023-10-31'
181+
pedigree_image: 9j2wBDAA...8QAPxAAAQQABAMGBAYDAAEDAg
182+
'404':
183+
description: not found error
184+
content:
185+
application/json:
186+
schema:
187+
$ref: '#/components/schemas/Error'
188+
'500':
189+
description: unexpected error
190+
content:
191+
application/json:
192+
schema:
193+
$ref: '#/components/schemas/Error'
194+
components:
195+
schemas:
196+
PetDetail:
197+
type: object
198+
properties:
199+
breeder:
200+
type: string
201+
date_of_birth:
202+
type: string
203+
format: date
204+
pedigree:
205+
$ref: '#/components/schemas/Pedigree'
206+
Pedigree:
207+
required:
208+
- registration_no
209+
- date_of_registration
210+
- pedigree_image
211+
type: object
212+
properties:
213+
registration_no:
214+
type: integer
215+
format: int64
216+
date_of_registration:
217+
type: string
218+
format: date
219+
pedigree_image:
220+
type: string
221+
Pet:
222+
type: object
223+
required:
224+
- id
225+
- name
226+
- category
227+
- age
228+
- sex
229+
properties:
230+
id:
231+
type: integer
232+
format: int64
233+
name:
234+
type: string
235+
maxLength: 50
236+
category:
237+
type: string
238+
maxLength: 10
239+
sub_category:
240+
type: string
241+
maxLength: 50
242+
age:
243+
type: integer
244+
format: int32
245+
sex:
246+
type: string
247+
maxLength: 6
248+
note:
249+
type: string
250+
maxLength: 200
251+
tag:
252+
type: string
253+
maxLength: 20
254+
Error:
255+
type: object
256+
required:
257+
- code
258+
- message
259+
properties:
260+
code:
261+
type: integer
262+
format: int32
263+
message:
264+
type: string
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
openapi: "3.0.3"
2+
info:
3+
version: 1.0.0
4+
title: Swagger Petstore
5+
license:
6+
name: MIT
7+
servers:
8+
- url: http://petstore.swagger.io/v1
9+
tags:
10+
- name: pets
11+
description: Everything about your Pets
12+
paths:
13+
/pets:
14+
get:
15+
$ref: "./pets_get/pets_get.yaml#/operation"
16+
post:
17+
$ref: "./pets_post/pets_post.yaml#/operation"
18+
/pets/{petId}:
19+
get:
20+
$ref: "./pets-pet-id_get/pets-pet-id_get.yaml#/operation"
21+
components:
22+
schemas:
23+
PetDetail:
24+
$ref: "./pets-pet-id_get/pets-pet-id_get.yaml#/components/schemas/PetDetail"
25+
Pedigree:
26+
$ref: "./pets-pet-id_get/pets-pet-id_get.yaml#/components/schemas/Pedigree"
27+
Pet:
28+
$ref: "./common/pet.yaml"
29+
Error:
30+
$ref: "./common/error.yaml"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pet:
2+
id: 10001
3+
name: ToyPoodle
4+
category: dog
5+
sub_category: ToyPoodle
6+
age: 1
7+
sex: male
8+
note: friendly
9+
tag: dog10001
10+
pet_detail:
11+
breeder: BreederName
12+
date_of_birth: '2023-10-31'
13+
pedigree:
14+
registration_no: 11111111
15+
date_of_registration: '2023-10-31'
16+
pedigree_image: 9j2wBDAA...8QAPxAAAQQABAMGBAYDAAEDAg

0 commit comments

Comments
 (0)