-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodels.yaml
More file actions
516 lines (516 loc) · 13.8 KB
/
Copy pathmodels.yaml
File metadata and controls
516 lines (516 loc) · 13.8 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
openapi: 3.0.1
info:
title: GOMP
version: "1.0"
paths: {}
components:
schemas:
accessLevel:
description: Access level assigned to a user and used for authorization scopes.
example: editor
type: string
enum:
- admin
- editor
- viewer
x-go-custom-tag: db:"access_level"
x-oapi-codegen-extra-tags:
db: access_level
recipeState:
description: Lifecycle state of a recipe.
example: active
type: string
enum:
- active
- archived
x-go-custom-tag: db:"current_state"
x-oapi-codegen-extra-tags:
db: current_state
searchField:
description: Recipe field to include when applying text search.
example: ingredients
type: string
enum:
- name
- ingredients
- directions
- storage_instructions
- nutrition_info
x-enum-varnames:
- Name
- Ingredients
- Directions
- StorageInstructions
- Nutrition
sortBy:
description: Field used to order recipe search results.
example: modified
type: string
enum:
- name
- id
- rating
- created
- modified
- random
x-go-custom-tag: db:"sort_by"
x-oapi-codegen-extra-tags:
db: sort_by
sortDir:
description: Direction used to sort search results.
example: desc
type: string
enum:
- asc
- desc
x-go-custom-tag: db:"sort_dir"
x-oapi-codegen-extra-tags:
db: sort_dir
appInfo:
description: Read-only application metadata.
example:
copyright: Copyright 2016-2026
version: 1.12.0
type: object
required:
- copyright
- version
properties:
copyright:
type: string
version:
type: string
appConfiguration:
description: Application-wide configuration values managed by administrators.
example:
title: The App Title
required:
- title
type: object
properties:
title:
type: string
x-go-custom-tag: db:"title"
x-oapi-codegen-extra-tags:
db: title
note:
description: A free-form note attached to a single recipe.
example:
id: 14
recipeId: 3
text: Add chopped parsley right before serving.
createdAt: "2026-04-21T14:05:00Z"
modifiedAt: "2026-04-21T14:05:00Z"
required:
- text
type: object
properties:
id:
type: integer
format: int64
readOnly: true
x-go-custom-tag: db:"id"
x-oapi-codegen-extra-tags:
db: id
recipeId:
type: integer
format: int64
readOnly: true
x-go-custom-tag: db:"recipe_id"
x-oapi-codegen-extra-tags:
db: recipe_id
text:
minLength: 1
type: string
x-go-custom-tag: db:"note"
x-oapi-codegen-extra-tags:
db: note
createdAt:
type: string
format: date-time
readOnly: true
x-go-custom-tag: db:"created_at"
x-oapi-codegen-extra-tags:
db: created_at
x-go-type: time.Time
modifiedAt:
type: string
format: date-time
readOnly: true
x-go-custom-tag: db:"modified_at"
x-oapi-codegen-extra-tags:
db: modified_at
x-go-type: time.Time
recipePatch:
description: Partial recipe update used for PATCH requests.
example:
state: archived
rating: 4
mainImageName: old-image.jpg
type: object
properties:
state:
$ref: "#/components/schemas/recipeState"
rating:
type: number
minimum: 0
maximum: 5
mainImageName:
type: string
recipeCompact:
description: Compact recipe representation used when returning lists.
example:
id: 3
name: Lemon Garlic Chicken
state: active
mainImageName: lemon-garlic-chicken.jpg
rating: 4.5
createdAt: "2026-04-19T09:00:00Z"
modifiedAt: "2026-04-20T18:15:00Z"
type: object
required:
- name
- state
- mainImageName
- rating
properties:
id:
type: integer
format: int64
readOnly: true
x-go-custom-tag: db:"id"
x-oapi-codegen-extra-tags:
db: id
name:
minLength: 1
type: string
x-go-custom-tag: db:"name"
state:
$ref: "#/components/schemas/recipeState"
mainImageName:
type: string
x-go-custom-tag: db:"main_image_name"
x-oapi-codegen-extra-tags:
db: main_image_name
rating:
type: number
readOnly: true
x-go-custom-tag: db:"rating"
x-oapi-codegen-extra-tags:
db: rating
createdAt:
type: string
format: date-time
readOnly: true
x-go-custom-tag: db:"created_at"
x-oapi-codegen-extra-tags:
db: created_at
x-go-type: time.Time
modifiedAt:
type: string
format: date-time
readOnly: true
x-go-custom-tag: db:"modified_at"
x-oapi-codegen-extra-tags:
db: modified_at
x-go-type: time.Time
recipe:
description: Full recipe details including ingredients, directions, and tags.
example:
id: 3
name: Lemon Garlic Chicken
state: active
mainImageName: lemon-garlic-chicken.jpg
servingSize: 4 servings
time: 45 minutes
nutritionInfo: 420 kcal per serving
ingredients: 1.5 lb chicken thighs\n2 tbsp olive oil\n3 cloves garlic\n1 lemon
directions: Marinate chicken, then roast at 400F until cooked through.
storageInstructions: Refrigerate in an airtight container for up to 3 days.
sourceUrl: https://example.com/recipes/lemon-garlic-chicken
tags:
- weeknight
- chicken
- high-protein
createdAt: "2026-04-19T09:00:00Z"
modifiedAt: "2026-04-20T18:15:00Z"
allOf:
- $ref: "#/components/schemas/recipeCompact"
- type: object
required:
- servingSize
- nutritionInfo
- ingredients
- directions
- storageInstructions
- sourceUrl
- time
- tags
properties:
servingSize:
type: string
x-go-custom-tag: db:"serving_size"
x-oapi-codegen-extra-tags:
db: serving_size
time:
type: string
x-go-custom-tag: db:"recipe_time"
x-oapi-codegen-extra-tags:
db: recipe_time
nutritionInfo:
type: string
x-go-custom-tag: db:"nutrition_info"
x-oapi-codegen-extra-tags:
db: nutrition_info
ingredients:
type: string
x-go-custom-tag: db:"ingredients"
x-oapi-codegen-extra-tags:
db: ingredients
directions:
type: string
x-go-custom-tag: db:"directions"
x-oapi-codegen-extra-tags:
db: directions
storageInstructions:
type: string
x-go-custom-tag: db:"storage_instructions"
x-oapi-codegen-extra-tags:
db: storage_instructions
sourceUrl:
type: string
x-go-custom-tag: db:"source_url"
x-oapi-codegen-extra-tags:
db: source_url
tags:
type: array
items:
type: string
x-go-custom-tag: db:"tags"
x-oapi-codegen-extra-tags:
db: tags
searchFilter:
description: Search filter criteria used to find recipes.
example:
query: chicken lemon
withPictures: true
fields:
- name
- ingredients
states:
- active
tags:
- weeknight
- high-protein
sortBy: modified
sortDir: desc
type: object
required:
- query
- withPictures
- fields
- states
- tags
- sortBy
- sortDir
properties:
query:
type: string
x-go-custom-tag: db:"query"
x-oapi-codegen-extra-tags:
db: query
withPictures:
type: boolean
nullable: true
x-go-custom-tag: db:"with_pictures"
x-oapi-codegen-extra-tags:
db: with_pictures
fields:
type: array
items:
$ref: "#/components/schemas/searchField"
states:
type: array
items:
$ref: "#/components/schemas/recipeState"
tags:
type: array
items:
type: string
sortBy:
$ref: "#/components/schemas/sortBy"
sortDir:
$ref: "#/components/schemas/sortDir"
savedSearchFilterCompact:
description: Compact saved search representation used when returning lists.
example:
id: 9
userId: 1
name: Weeknight Dinners
required:
- name
type: object
properties:
id:
type: integer
format: int64
readOnly: true
x-go-custom-tag: db:"id"
x-oapi-codegen-extra-tags:
db: id
userId:
type: integer
format: int64
readOnly: true
x-go-custom-tag: db:"user_id"
x-oapi-codegen-extra-tags:
db: user_id
name:
minLength: 1
type: string
x-go-custom-tag: db:"name"
x-oapi-codegen-extra-tags:
db: name
savedSearchFilter:
description: Full saved search filter with metadata and filtering criteria.
example:
id: 9
userId: 1
name: Weeknight Dinners
query: chicken lemon
withPictures: true
fields:
- name
- ingredients
states:
- active
tags:
- weeknight
sortBy: modified
sortDir: desc
allOf:
- $ref: "#/components/schemas/savedSearchFilterCompact"
- $ref: "#/components/schemas/searchFilter"
user:
description: User account details and authorization level.
example:
id: 1
username: user1
accessLevel: admin
createdAt: "2026-04-21T12:00:00Z"
modifiedAt: "2026-04-21T12:00:00Z"
type: object
required:
- username
- accessLevel
properties:
id:
type: integer
format: int64
readOnly: true
x-go-custom-tag: db:"id"
x-oapi-codegen-extra-tags:
db: id
username:
type: string
x-go-custom-tag: db:"username"
x-oapi-codegen-extra-tags:
db: username
accessLevel:
$ref: "#/components/schemas/accessLevel"
createdAt:
type: string
format: date-time
readOnly: true
x-go-custom-tag: db:"created_at"
x-oapi-codegen-extra-tags:
db: created_at
x-go-type: time.Time
modifiedAt:
type: string
format: date-time
readOnly: true
x-go-custom-tag: db:"modified_at"
x-oapi-codegen-extra-tags:
db: modified_at
x-go-type: time.Time
userSettings:
description: Per-user UI preferences and quick-access tag settings.
example:
userId: 1
homeTitle: My Home Title
homeImageUrl: https://example.com/my-image.jpg
favoriteTags:
- quick
- kid-friendly
- vegetarian
type: object
required:
- favoriteTags
properties:
userId:
type: integer
format: int64
readOnly: true
x-go-custom-tag: db:"user_id"
x-oapi-codegen-extra-tags:
db: user_id
homeTitle:
type: string
nullable: true
x-go-custom-tag: db:"home_title"
x-oapi-codegen-extra-tags:
db: home_title
homeImageUrl:
type: string
nullable: true
x-go-custom-tag: db:"home_image_url"
x-oapi-codegen-extra-tags:
db: home_image_url
favoriteTags:
type: array
items:
type: string
x-go-custom-tag: db:"favorite_tags"
x-oapi-codegen-extra-tags:
db: favorite_tags
backup:
description: A full export of all application data for backup and restore purposes.
example:
metadata:
name: 2026-04-21
version: 1.0
fileName: backup-2026-04-21.zip
fileUrl: /backups/backup-2026-04-21.zip
type: object
required:
- metadata
- fileName
- fileUrl
properties:
sizeInBytes:
type: integer
format: int64
metadata:
$ref: "#/components/schemas/backupMetadata"
fileName:
type: string
fileUrl:
type: string
format: uri
backupMetadata:
description: |
Metadata about a backup file,
such as its name and the version of the application that created it.
example:
name: backup-2026-04-21
version: 1.0
type: object
required:
- name
- version
properties:
name:
type: string
version:
type: string