-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentation.yaml
More file actions
214 lines (200 loc) · 5.27 KB
/
Copy pathdocumentation.yaml
File metadata and controls
214 lines (200 loc) · 5.27 KB
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
openapi: 3.0.4
info:
title: Cookbook API
description: Sample server for IO practice.
version: 1.0.0
servers:
- url: /
description: Local server
security:
- userArea: [ ]
paths:
/profile:
get:
operationId: getProfile
summary: Returns user profile.
description: Returns the profile of the user.
responses:
200:
description: User profile
content:
application/json:
schema:
$ref: '#/components/schemas/Profile'
401:
description: Unauthorized
/recipes:
get:
operationId: getRecipes
summary: Returns a list of recipes.
description: Lists all recipes in the database.
responses:
200:
description: A list of recipes
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ListRecipe'
post:
operationId: addRecipe
summary: Adds new recipe
description: Adds a new recipe to the database.
requestBody:
description: Recipe to add
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
responses:
200:
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
401:
description: Unauthorized
/recipes/{id}:
parameters:
- $ref: '#/components/parameters/id'
get:
operationId: getRecipe
summary: Complete recipe.
description: Returns full recipe.
responses:
200:
description: A complete recipe
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
401:
description: Unauthorized
404:
description: Recipe not found
delete:
operationId: deleteRecipe
summary: Delete recipe
description: Deletes a recipe from the system.
responses:
204:
description: Recipe deleted
404:
description: Recipe not found
401:
description: Unauthorized
/recipes/{id}/image:
parameters:
- $ref: '#/components/parameters/id'
put:
operationId: uploadRecipeImage
summary: Upload image
description: Uploads an image for the recipe.
requestBody:
content:
image/png:
schema:
type: string
format: binary
responses:
200:
description: Image uploaded successfully
content:
application/json:
schema:
type: object
properties:
imageUrl:
type: string
format: uri
description: URI string for the uploaded image
example: https://example.com/picture.jpg
404:
description: Recipe not found
401:
description: Unauthorized
components:
schemas:
Profile:
type: object
description: User profile
required:
- id
- name
properties:
id:
description: Unique identifier for the user
type: number
format: int64
minimum: 1
example: 1
name:
description: User name
type: string
example: Ivan Ivanov
RecipeId:
type: string
format: uuid
description: Unique identifier for the recipe
example: 2ea32889-53a1-4d32-8f6b-25c5098d9816
ListRecipe:
type: object
description: Recipe object for the list
required:
- id
- title
- category
- dateTimeCreated
- deleted
properties:
id:
$ref: '#/components/schemas/RecipeId'
title:
type: string
description: Recipe title
example: Spaghetti Bolognese
category:
type: string
description: Recipe category
example: Pasta
imageUrl:
type: string
format: uri
description: URI string for the recipe image
example: https://example.com/picture.jpg
dateTimeCreated:
type: string
format: date-time
description: Recipe description
example: 2023-10-01T12:00:00Z
deleted:
type: boolean
description: Indicates if the recipe is deleted
example: false
Recipe:
allOf:
- $ref: '#/components/schemas/ListRecipe'
- type: object
description: Complete recipe object
required:
- description
properties:
description:
type: string
description: Recipe description
example: Take a large pot of salted water and bring to a boil. Add the pasta and cook according to package instructions. Drain and set aside.
parameters:
id:
name: id
in: path
description: Unique identifier for the recipe
required: true
schema:
$ref: '#/components/schemas/RecipeId'
securitySchemes:
userArea:
type: http
scheme: basic