-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapipastries-openapi.yml
191 lines (191 loc) · 5.33 KB
/
apipastries-openapi.yml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
---
openapi: 3.0.2
info:
title: API Pastries
version: 0.0.1
description: API definition of API Pastry sample app
contact:
name: Laurent Broudoux
url: http://github.com/lbroudoux
email: laurent.broudoux@gmail.com
license:
name: MIT License
url: https://opensource.org/licenses/MIT
paths:
/pastries:
summary: Global operations on pastries
get:
tags:
- pastry
parameters:
- name: size
description: pastry size
schema:
type: string
in: query
required: true
examples:
pastries_s:
value: S
pastries_m:
value: M
pastries_l:
value: L
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pastry'
examples:
pastries_s:
value:
- name: Tartelette Fraise
description: Delicieuse Tartelette aux Fraises fraiches
size: S
price: 2
status: available
pastries_m:
value:
- name: Divorces
description: Delicieux Divorces pas calorique du tout
size: M
price: 2.8
status: available
- name: Eclair Cafe
description: Delicieux Eclair au Cafe pas calorique du tout
size: M
price: 2.5
status: available
pastries_l:
value:
- name: Baba Rhum
description: Delicieux Baba au Rhum pas calorique du tout
size: L
price: 3.2
status: available
- name: Millefeuille
description: Delicieux Millefeuille pas calorique du tout
size: L
price: 4.4
status: available
description: Get list of pastries by size
operationId: GetPastriesBySize
summary: Get list of pastries by size
/pastries/{name}:
summary: Specific operation on pastry
get:
parameters:
- examples:
Eclair Cafe:
value: Eclair Cafe
Millefeuille:
value: Millefeuille
name: name
description: pastry name
schema:
type: string
in: path
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Pastry'
examples:
Eclair Cafe:
value:
name: Eclair Cafe
description: Delicieux Eclair au Cafe pas calorique du tout
size: M
price: 2.5
status: available
Millefeuille:
value:
name: Millefeuille
description: Delicieux Millefeuille pas calorique du tout
size: L
price: 4.4
status: available
description: Pastry with specified name
operationId: GetPastryByName
summary: Get Pastry by name
description: Get Pastry by name
patch:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Pastry'
examples:
Eclair Cafe:
value:
price: 2.6
required: true
parameters:
- examples:
Eclair Cafe:
value: Eclair Cafe
name: name
description: pastry name
schema:
type: string
in: path
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Pastry'
examples:
Eclair Cafe:
value:
name: Eclair Cafe
description: Delicieux Eclair au Cafe pas calorique du tout
size: M
price: 2.6
status: available
description: Changed pastry
operationId: PatchPastry
summary: Patch existing pastry
parameters:
- name: name
description: pastry name
schema:
type: string
in: path
required: true
components:
schemas:
Pastry:
title: Root Type for Pastry
description: The root of the Pastry type's schema.
type: object
properties:
name:
description: Name of this pastry
type: string
description:
description: A short description of this pastry
type: string
size:
description: Size of pastry (S, M, L)
type: string
price:
description: Price (in USD) of this pastry
type: number
status:
description: Status in stock (available, out_of_stock)
type: string
required:
- name
- price
- status
additionalProperties: false
tags:
- name: pastry
description: Pastry resource