@terreno/api 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +170 -0
  3. package/biome.jsonc +22 -0
  4. package/bunfig.toml +4 -0
  5. package/dist/api.d.ts +227 -0
  6. package/dist/api.js +1024 -0
  7. package/dist/api.test.d.ts +1 -0
  8. package/dist/api.test.js +2143 -0
  9. package/dist/auth.d.ts +50 -0
  10. package/dist/auth.js +512 -0
  11. package/dist/auth.test.d.ts +1 -0
  12. package/dist/auth.test.js +778 -0
  13. package/dist/errors.d.ts +75 -0
  14. package/dist/errors.js +216 -0
  15. package/dist/example.d.ts +1 -0
  16. package/dist/example.js +118 -0
  17. package/dist/expressServer.d.ts +35 -0
  18. package/dist/expressServer.js +436 -0
  19. package/dist/index.d.ts +14 -0
  20. package/dist/index.js +30 -0
  21. package/dist/logger.d.ts +23 -0
  22. package/dist/logger.js +249 -0
  23. package/dist/middleware.d.ts +10 -0
  24. package/dist/middleware.js +52 -0
  25. package/dist/notifiers/googleChatNotifier.d.ts +5 -0
  26. package/dist/notifiers/googleChatNotifier.js +130 -0
  27. package/dist/notifiers/googleChatNotifier.test.d.ts +1 -0
  28. package/dist/notifiers/googleChatNotifier.test.js +260 -0
  29. package/dist/notifiers/index.d.ts +3 -0
  30. package/dist/notifiers/index.js +19 -0
  31. package/dist/notifiers/slackNotifier.d.ts +5 -0
  32. package/dist/notifiers/slackNotifier.js +130 -0
  33. package/dist/notifiers/slackNotifier.test.d.ts +1 -0
  34. package/dist/notifiers/slackNotifier.test.js +259 -0
  35. package/dist/notifiers/zoomNotifier.d.ts +34 -0
  36. package/dist/notifiers/zoomNotifier.js +181 -0
  37. package/dist/notifiers/zoomNotifier.test.d.ts +1 -0
  38. package/dist/notifiers/zoomNotifier.test.js +370 -0
  39. package/dist/openApi.d.ts +60 -0
  40. package/dist/openApi.js +441 -0
  41. package/dist/openApi.test.d.ts +1 -0
  42. package/dist/openApi.test.js +445 -0
  43. package/dist/openApiBuilder.d.ts +419 -0
  44. package/dist/openApiBuilder.js +424 -0
  45. package/dist/openApiBuilder.test.d.ts +1 -0
  46. package/dist/openApiBuilder.test.js +509 -0
  47. package/dist/openApiEtag.d.ts +7 -0
  48. package/dist/openApiEtag.js +38 -0
  49. package/dist/permissions.d.ts +26 -0
  50. package/dist/permissions.js +331 -0
  51. package/dist/permissions.test.d.ts +1 -0
  52. package/dist/permissions.test.js +413 -0
  53. package/dist/plugins.d.ts +67 -0
  54. package/dist/plugins.js +315 -0
  55. package/dist/plugins.test.d.ts +1 -0
  56. package/dist/plugins.test.js +639 -0
  57. package/dist/populate.d.ts +14 -0
  58. package/dist/populate.js +315 -0
  59. package/dist/populate.test.d.ts +1 -0
  60. package/dist/populate.test.js +133 -0
  61. package/dist/response.d.ts +0 -0
  62. package/dist/response.js +1 -0
  63. package/dist/tests/bunSetup.d.ts +1 -0
  64. package/dist/tests/bunSetup.js +297 -0
  65. package/dist/tests/index.d.ts +1 -0
  66. package/dist/tests/index.js +17 -0
  67. package/dist/tests.d.ts +99 -0
  68. package/dist/tests.js +273 -0
  69. package/dist/transformers.d.ts +25 -0
  70. package/dist/transformers.js +217 -0
  71. package/dist/transformers.test.d.ts +1 -0
  72. package/dist/transformers.test.js +370 -0
  73. package/dist/utils.d.ts +11 -0
  74. package/dist/utils.js +143 -0
  75. package/dist/utils.test.d.ts +1 -0
  76. package/dist/utils.test.js +14 -0
  77. package/index.ts +1 -0
  78. package/package.json +88 -0
  79. package/src/__snapshots__/openApi.test.ts.snap +4814 -0
  80. package/src/__snapshots__/openApiBuilder.test.ts.snap +1485 -0
  81. package/src/api.test.ts +1661 -0
  82. package/src/api.ts +1036 -0
  83. package/src/auth.test.ts +550 -0
  84. package/src/auth.ts +408 -0
  85. package/src/errors.ts +225 -0
  86. package/src/example.ts +99 -0
  87. package/src/express.d.ts +5 -0
  88. package/src/expressServer.ts +387 -0
  89. package/src/index.ts +14 -0
  90. package/src/logger.ts +190 -0
  91. package/src/middleware.ts +18 -0
  92. package/src/notifiers/googleChatNotifier.test.ts +114 -0
  93. package/src/notifiers/googleChatNotifier.ts +47 -0
  94. package/src/notifiers/index.ts +3 -0
  95. package/src/notifiers/slackNotifier.test.ts +113 -0
  96. package/src/notifiers/slackNotifier.ts +55 -0
  97. package/src/notifiers/zoomNotifier.test.ts +207 -0
  98. package/src/notifiers/zoomNotifier.ts +111 -0
  99. package/src/openApi.test.ts +331 -0
  100. package/src/openApi.ts +494 -0
  101. package/src/openApiBuilder.test.ts +442 -0
  102. package/src/openApiBuilder.ts +636 -0
  103. package/src/openApiEtag.ts +40 -0
  104. package/src/permissions.test.ts +219 -0
  105. package/src/permissions.ts +228 -0
  106. package/src/plugins.test.ts +390 -0
  107. package/src/plugins.ts +289 -0
  108. package/src/populate.test.ts +65 -0
  109. package/src/populate.ts +258 -0
  110. package/src/response.ts +0 -0
  111. package/src/tests/bunSetup.ts +234 -0
  112. package/src/tests/index.ts +1 -0
  113. package/src/tests.ts +218 -0
  114. package/src/transformers.test.ts +202 -0
  115. package/src/transformers.ts +170 -0
  116. package/src/utils.test.ts +14 -0
  117. package/src/utils.ts +47 -0
  118. package/tsconfig.json +60 -0
  119. package/types.d.ts +17 -0
@@ -0,0 +1,4814 @@
1
+ // Bun Snapshot v1, https://bun.sh/docs/test/snapshots
2
+
3
+ exports[`openApi gets the openapi.json 1`] = `
4
+ {
5
+ "components": {
6
+ "schemas": {
7
+ "APIError": {
8
+ "properties": {
9
+ "code": {
10
+ "description": "An application-specific error code, expressed as a string value.",
11
+ "type": "string",
12
+ },
13
+ "detail": {
14
+ "description": "A human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.",
15
+ "type": "string",
16
+ },
17
+ "id": {
18
+ "description": "A unique identifier for this particular occurrence of the problem.",
19
+ "type": "string",
20
+ },
21
+ "links": {
22
+ "properties": {
23
+ "about": {
24
+ "description": "A link that leads to further details about this particular occurrence of the problem. When derefenced, this URI SHOULD return a human-readable description of the error.",
25
+ "type": "string",
26
+ },
27
+ "type": {
28
+ "description": "A link that identifies the type of error that this particular error is an instance of. This URI SHOULD be dereferencable to a human-readable explanation of the general error.",
29
+ "type": "string",
30
+ },
31
+ },
32
+ "type": "object",
33
+ },
34
+ "meta": {
35
+ "description": "A meta object containing non-standard meta-information about the error.",
36
+ "type": "object",
37
+ },
38
+ "source": {
39
+ "properties": {
40
+ "header": {
41
+ "description": "A string indicating the name of a single request header which caused the error.",
42
+ "type": "string",
43
+ },
44
+ "parameter": {
45
+ "description": "A string indicating which URI query parameter caused the error.",
46
+ "type": "string",
47
+ },
48
+ "pointer": {
49
+ "description": "A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].",
50
+ "type": "string",
51
+ },
52
+ },
53
+ "type": "object",
54
+ },
55
+ "status": {
56
+ "description": "The HTTP status code applicable to this problem, expressed as a string value.",
57
+ "type": "number",
58
+ },
59
+ "title": {
60
+ "description": "The error message",
61
+ "type": "string",
62
+ },
63
+ },
64
+ "type": "object",
65
+ },
66
+ },
67
+ },
68
+ "info": {
69
+ "description": "Generated docs from an Express api",
70
+ "title": "Express Application",
71
+ "version": "1.0.0",
72
+ },
73
+ "openapi": "3.0.0",
74
+ "paths": {
75
+ "/food/": {
76
+ "get": {
77
+ "parameters": [
78
+ {
79
+ "in": "query",
80
+ "name": "_id",
81
+ "schema": {
82
+ "properties": {
83
+ "$in": {
84
+ "items": {
85
+ "type": "string",
86
+ },
87
+ "type": "array",
88
+ },
89
+ },
90
+ "type": "object",
91
+ },
92
+ },
93
+ {
94
+ "in": "query",
95
+ "name": "calories",
96
+ "schema": {
97
+ "oneOf": [
98
+ {
99
+ "type": "number",
100
+ },
101
+ {
102
+ "properties": {
103
+ "$gt": {
104
+ "type": "number",
105
+ },
106
+ "$gte": {
107
+ "type": "number",
108
+ },
109
+ "$lt": {
110
+ "type": "number",
111
+ },
112
+ "$lte": {
113
+ "type": "number",
114
+ },
115
+ },
116
+ "type": "object",
117
+ },
118
+ ],
119
+ },
120
+ },
121
+ {
122
+ "in": "query",
123
+ "name": "page",
124
+ "schema": {
125
+ "type": "number",
126
+ },
127
+ },
128
+ {
129
+ "in": "query",
130
+ "name": "sort",
131
+ "schema": {
132
+ "type": "string",
133
+ },
134
+ },
135
+ {
136
+ "in": "query",
137
+ "name": "limit",
138
+ "schema": {
139
+ "type": "number",
140
+ },
141
+ },
142
+ ],
143
+ "responses": {
144
+ "200": {
145
+ "content": {
146
+ "application/json": {
147
+ "schema": {
148
+ "properties": {
149
+ "data": {
150
+ "items": {
151
+ "properties": {
152
+ "_id": {
153
+ "type": "string",
154
+ },
155
+ "calories": {
156
+ "type": "number",
157
+ },
158
+ "categories": {
159
+ "items": {
160
+ "properties": {
161
+ "_id": {
162
+ "type": "string",
163
+ },
164
+ "created": {
165
+ "format": "date-time",
166
+ "type": "string",
167
+ },
168
+ "name": {
169
+ "type": "string",
170
+ },
171
+ "show": {
172
+ "type": "boolean",
173
+ },
174
+ "updated": {
175
+ "format": "date-time",
176
+ "type": "string",
177
+ },
178
+ },
179
+ "required": [],
180
+ "type": "object",
181
+ },
182
+ "type": "array",
183
+ },
184
+ "created": {
185
+ "format": "date-time",
186
+ "type": "string",
187
+ },
188
+ "description": {
189
+ "type": "any",
190
+ },
191
+ "eatenBy": {
192
+ "items": {
193
+ "properties": {
194
+ "__t": {
195
+ "type": "string",
196
+ },
197
+ "_id": {
198
+ "type": "string",
199
+ },
200
+ "admin": {
201
+ "default": false,
202
+ "type": "boolean",
203
+ },
204
+ "age": {
205
+ "type": "number",
206
+ },
207
+ "attempts": {
208
+ "default": 0,
209
+ "type": "number",
210
+ },
211
+ "created": {
212
+ "format": "date-time",
213
+ "type": "string",
214
+ },
215
+ "disabled": {
216
+ "default": false,
217
+ "description": "When a user is set to disable, all requests will return a 401",
218
+ "type": "boolean",
219
+ },
220
+ "email": {
221
+ "type": "string",
222
+ },
223
+ "hash": {
224
+ "type": "string",
225
+ },
226
+ "last": {
227
+ "format": "date-time",
228
+ "type": "string",
229
+ },
230
+ "name": {
231
+ "type": "string",
232
+ },
233
+ "salt": {
234
+ "type": "string",
235
+ },
236
+ "updated": {
237
+ "format": "date-time",
238
+ "type": "string",
239
+ },
240
+ "username": {
241
+ "type": "string",
242
+ },
243
+ },
244
+ "type": "object",
245
+ },
246
+ "type": "array",
247
+ },
248
+ "expiration": {
249
+ "type": "dateonly",
250
+ },
251
+ "foo": {
252
+ "type": "string",
253
+ },
254
+ "hidden": {
255
+ "type": "boolean",
256
+ },
257
+ "lastEatenWith": {
258
+ "additionalProperties": {
259
+ "format": "date-time",
260
+ "type": "string",
261
+ },
262
+ "type": "object",
263
+ },
264
+ "likesIds": {
265
+ "items": {
266
+ "properties": {
267
+ "_id": {
268
+ "type": "string",
269
+ },
270
+ "likes": {
271
+ "type": "boolean",
272
+ },
273
+ "userId": {
274
+ "type": "string",
275
+ },
276
+ },
277
+ "required": [],
278
+ "type": "object",
279
+ },
280
+ "type": "array",
281
+ },
282
+ "name": {
283
+ "type": "string",
284
+ },
285
+ "ownerId": {
286
+ "properties": {
287
+ "__t": {
288
+ "type": "string",
289
+ },
290
+ "_id": {
291
+ "type": "string",
292
+ },
293
+ "admin": {
294
+ "default": false,
295
+ "type": "boolean",
296
+ },
297
+ "age": {
298
+ "type": "number",
299
+ },
300
+ "attempts": {
301
+ "default": 0,
302
+ "type": "number",
303
+ },
304
+ "created": {
305
+ "format": "date-time",
306
+ "type": "string",
307
+ },
308
+ "disabled": {
309
+ "default": false,
310
+ "description": "When a user is set to disable, all requests will return a 401",
311
+ "type": "boolean",
312
+ },
313
+ "email": {
314
+ "type": "string",
315
+ },
316
+ "hash": {
317
+ "type": "string",
318
+ },
319
+ "last": {
320
+ "format": "date-time",
321
+ "type": "string",
322
+ },
323
+ "name": {
324
+ "type": "string",
325
+ },
326
+ "salt": {
327
+ "type": "string",
328
+ },
329
+ "updated": {
330
+ "format": "date-time",
331
+ "type": "string",
332
+ },
333
+ "username": {
334
+ "type": "string",
335
+ },
336
+ },
337
+ "type": "object",
338
+ },
339
+ "source": {
340
+ "properties": {
341
+ "dateAdded": {
342
+ "type": "string",
343
+ },
344
+ "href": {
345
+ "type": "string",
346
+ },
347
+ "name": {
348
+ "type": "string",
349
+ },
350
+ },
351
+ "type": "object",
352
+ },
353
+ "tags": {
354
+ "items": {
355
+ "type": "string",
356
+ },
357
+ "type": "array",
358
+ },
359
+ },
360
+ "required": [
361
+ "likesIds",
362
+ "_id",
363
+ "created",
364
+ "updated",
365
+ ],
366
+ "type": "object",
367
+ },
368
+ "type": "array",
369
+ },
370
+ "limit": {
371
+ "type": "number",
372
+ },
373
+ "more": {
374
+ "type": "boolean",
375
+ },
376
+ "page": {
377
+ "type": "number",
378
+ },
379
+ "total": {
380
+ "type": "number",
381
+ },
382
+ },
383
+ "type": "object",
384
+ },
385
+ },
386
+ },
387
+ "description": "Successful list",
388
+ },
389
+ "400": {
390
+ "content": {
391
+ "application/json": {
392
+ "schema": {
393
+ "$ref": "#/components/schemas/APIError",
394
+ },
395
+ },
396
+ },
397
+ "description": "Bad request",
398
+ },
399
+ "401": {
400
+ "description": "The user must be authenticated",
401
+ },
402
+ "403": {
403
+ "content": {
404
+ "application/json": {
405
+ "schema": {
406
+ "$ref": "#/components/schemas/APIError",
407
+ },
408
+ },
409
+ },
410
+ "description": "The user is not allowed to perform this action on this document",
411
+ },
412
+ "404": {
413
+ "content": {
414
+ "application/json": {
415
+ "schema": {
416
+ "$ref": "#/components/schemas/APIError",
417
+ },
418
+ },
419
+ },
420
+ "description": "Document not found",
421
+ },
422
+ "405": {
423
+ "content": {
424
+ "application/json": {
425
+ "schema": {
426
+ "$ref": "#/components/schemas/APIError",
427
+ },
428
+ },
429
+ },
430
+ "description": "The user is not allowed to perform this action on any document",
431
+ },
432
+ },
433
+ "tags": [
434
+ "foods",
435
+ ],
436
+ },
437
+ "post": {
438
+ "requestBody": {
439
+ "content": {
440
+ "application/json": {
441
+ "schema": {
442
+ "properties": {
443
+ "_id": {
444
+ "type": "string",
445
+ },
446
+ "calories": {
447
+ "type": "number",
448
+ },
449
+ "categories": {
450
+ "items": {
451
+ "properties": {
452
+ "_id": {
453
+ "type": "string",
454
+ },
455
+ "created": {
456
+ "format": "date-time",
457
+ "type": "string",
458
+ },
459
+ "name": {
460
+ "type": "string",
461
+ },
462
+ "show": {
463
+ "type": "boolean",
464
+ },
465
+ "updated": {
466
+ "format": "date-time",
467
+ "type": "string",
468
+ },
469
+ },
470
+ "required": [],
471
+ "type": "object",
472
+ },
473
+ "type": "array",
474
+ },
475
+ "created": {
476
+ "format": "date-time",
477
+ "type": "string",
478
+ },
479
+ "description": {
480
+ "type": "any",
481
+ },
482
+ "eatenBy": {
483
+ "items": {
484
+ "properties": {
485
+ "__t": {
486
+ "type": "string",
487
+ },
488
+ "_id": {
489
+ "type": "string",
490
+ },
491
+ "admin": {
492
+ "default": false,
493
+ "type": "boolean",
494
+ },
495
+ "age": {
496
+ "type": "number",
497
+ },
498
+ "attempts": {
499
+ "default": 0,
500
+ "type": "number",
501
+ },
502
+ "created": {
503
+ "format": "date-time",
504
+ "type": "string",
505
+ },
506
+ "disabled": {
507
+ "default": false,
508
+ "description": "When a user is set to disable, all requests will return a 401",
509
+ "type": "boolean",
510
+ },
511
+ "email": {
512
+ "type": "string",
513
+ },
514
+ "hash": {
515
+ "type": "string",
516
+ },
517
+ "last": {
518
+ "format": "date-time",
519
+ "type": "string",
520
+ },
521
+ "name": {
522
+ "type": "string",
523
+ },
524
+ "salt": {
525
+ "type": "string",
526
+ },
527
+ "updated": {
528
+ "format": "date-time",
529
+ "type": "string",
530
+ },
531
+ "username": {
532
+ "type": "string",
533
+ },
534
+ },
535
+ "type": "object",
536
+ },
537
+ "type": "array",
538
+ },
539
+ "expiration": {
540
+ "type": "dateonly",
541
+ },
542
+ "foo": {
543
+ "type": "string",
544
+ },
545
+ "hidden": {
546
+ "type": "boolean",
547
+ },
548
+ "lastEatenWith": {
549
+ "additionalProperties": {
550
+ "format": "date-time",
551
+ "type": "string",
552
+ },
553
+ "type": "object",
554
+ },
555
+ "likesIds": {
556
+ "items": {
557
+ "properties": {
558
+ "_id": {
559
+ "type": "string",
560
+ },
561
+ "likes": {
562
+ "type": "boolean",
563
+ },
564
+ "userId": {
565
+ "type": "string",
566
+ },
567
+ },
568
+ "required": [],
569
+ "type": "object",
570
+ },
571
+ "type": "array",
572
+ },
573
+ "name": {
574
+ "type": "string",
575
+ },
576
+ "ownerId": {
577
+ "properties": {
578
+ "__t": {
579
+ "type": "string",
580
+ },
581
+ "_id": {
582
+ "type": "string",
583
+ },
584
+ "admin": {
585
+ "default": false,
586
+ "type": "boolean",
587
+ },
588
+ "age": {
589
+ "type": "number",
590
+ },
591
+ "attempts": {
592
+ "default": 0,
593
+ "type": "number",
594
+ },
595
+ "created": {
596
+ "format": "date-time",
597
+ "type": "string",
598
+ },
599
+ "disabled": {
600
+ "default": false,
601
+ "description": "When a user is set to disable, all requests will return a 401",
602
+ "type": "boolean",
603
+ },
604
+ "email": {
605
+ "type": "string",
606
+ },
607
+ "hash": {
608
+ "type": "string",
609
+ },
610
+ "last": {
611
+ "format": "date-time",
612
+ "type": "string",
613
+ },
614
+ "name": {
615
+ "type": "string",
616
+ },
617
+ "salt": {
618
+ "type": "string",
619
+ },
620
+ "updated": {
621
+ "format": "date-time",
622
+ "type": "string",
623
+ },
624
+ "username": {
625
+ "type": "string",
626
+ },
627
+ },
628
+ "type": "object",
629
+ },
630
+ "source": {
631
+ "properties": {
632
+ "dateAdded": {
633
+ "type": "string",
634
+ },
635
+ "href": {
636
+ "type": "string",
637
+ },
638
+ "name": {
639
+ "type": "string",
640
+ },
641
+ },
642
+ "type": "object",
643
+ },
644
+ "tags": {
645
+ "items": {
646
+ "type": "string",
647
+ },
648
+ "type": "array",
649
+ },
650
+ },
651
+ "type": "object",
652
+ },
653
+ },
654
+ },
655
+ "required": true,
656
+ },
657
+ "responses": {
658
+ "201": {
659
+ "content": {
660
+ "application/json": {
661
+ "schema": {
662
+ "properties": {
663
+ "_id": {
664
+ "type": "string",
665
+ },
666
+ "calories": {
667
+ "type": "number",
668
+ },
669
+ "categories": {
670
+ "items": {
671
+ "properties": {
672
+ "_id": {
673
+ "type": "string",
674
+ },
675
+ "created": {
676
+ "format": "date-time",
677
+ "type": "string",
678
+ },
679
+ "name": {
680
+ "type": "string",
681
+ },
682
+ "show": {
683
+ "type": "boolean",
684
+ },
685
+ "updated": {
686
+ "format": "date-time",
687
+ "type": "string",
688
+ },
689
+ },
690
+ "required": [],
691
+ "type": "object",
692
+ },
693
+ "type": "array",
694
+ },
695
+ "created": {
696
+ "format": "date-time",
697
+ "type": "string",
698
+ },
699
+ "description": {
700
+ "type": "any",
701
+ },
702
+ "eatenBy": {
703
+ "items": {
704
+ "properties": {
705
+ "__t": {
706
+ "type": "string",
707
+ },
708
+ "_id": {
709
+ "type": "string",
710
+ },
711
+ "admin": {
712
+ "default": false,
713
+ "type": "boolean",
714
+ },
715
+ "age": {
716
+ "type": "number",
717
+ },
718
+ "attempts": {
719
+ "default": 0,
720
+ "type": "number",
721
+ },
722
+ "created": {
723
+ "format": "date-time",
724
+ "type": "string",
725
+ },
726
+ "disabled": {
727
+ "default": false,
728
+ "description": "When a user is set to disable, all requests will return a 401",
729
+ "type": "boolean",
730
+ },
731
+ "email": {
732
+ "type": "string",
733
+ },
734
+ "hash": {
735
+ "type": "string",
736
+ },
737
+ "last": {
738
+ "format": "date-time",
739
+ "type": "string",
740
+ },
741
+ "name": {
742
+ "type": "string",
743
+ },
744
+ "salt": {
745
+ "type": "string",
746
+ },
747
+ "updated": {
748
+ "format": "date-time",
749
+ "type": "string",
750
+ },
751
+ "username": {
752
+ "type": "string",
753
+ },
754
+ },
755
+ "type": "object",
756
+ },
757
+ "type": "array",
758
+ },
759
+ "expiration": {
760
+ "type": "dateonly",
761
+ },
762
+ "foo": {
763
+ "type": "string",
764
+ },
765
+ "hidden": {
766
+ "type": "boolean",
767
+ },
768
+ "lastEatenWith": {
769
+ "additionalProperties": {
770
+ "format": "date-time",
771
+ "type": "string",
772
+ },
773
+ "type": "object",
774
+ },
775
+ "likesIds": {
776
+ "items": {
777
+ "properties": {
778
+ "_id": {
779
+ "type": "string",
780
+ },
781
+ "likes": {
782
+ "type": "boolean",
783
+ },
784
+ "userId": {
785
+ "type": "string",
786
+ },
787
+ },
788
+ "required": [],
789
+ "type": "object",
790
+ },
791
+ "type": "array",
792
+ },
793
+ "name": {
794
+ "type": "string",
795
+ },
796
+ "ownerId": {
797
+ "properties": {
798
+ "__t": {
799
+ "type": "string",
800
+ },
801
+ "_id": {
802
+ "type": "string",
803
+ },
804
+ "admin": {
805
+ "default": false,
806
+ "type": "boolean",
807
+ },
808
+ "age": {
809
+ "type": "number",
810
+ },
811
+ "attempts": {
812
+ "default": 0,
813
+ "type": "number",
814
+ },
815
+ "created": {
816
+ "format": "date-time",
817
+ "type": "string",
818
+ },
819
+ "disabled": {
820
+ "default": false,
821
+ "description": "When a user is set to disable, all requests will return a 401",
822
+ "type": "boolean",
823
+ },
824
+ "email": {
825
+ "type": "string",
826
+ },
827
+ "hash": {
828
+ "type": "string",
829
+ },
830
+ "last": {
831
+ "format": "date-time",
832
+ "type": "string",
833
+ },
834
+ "name": {
835
+ "type": "string",
836
+ },
837
+ "salt": {
838
+ "type": "string",
839
+ },
840
+ "updated": {
841
+ "format": "date-time",
842
+ "type": "string",
843
+ },
844
+ "username": {
845
+ "type": "string",
846
+ },
847
+ },
848
+ "type": "object",
849
+ },
850
+ "source": {
851
+ "properties": {
852
+ "dateAdded": {
853
+ "type": "string",
854
+ },
855
+ "href": {
856
+ "type": "string",
857
+ },
858
+ "name": {
859
+ "type": "string",
860
+ },
861
+ },
862
+ "type": "object",
863
+ },
864
+ "tags": {
865
+ "items": {
866
+ "type": "string",
867
+ },
868
+ "type": "array",
869
+ },
870
+ },
871
+ "required": [
872
+ "likesIds",
873
+ "_id",
874
+ "created",
875
+ "updated",
876
+ ],
877
+ "type": "object",
878
+ },
879
+ },
880
+ },
881
+ "description": "Successful create",
882
+ },
883
+ "400": {
884
+ "content": {
885
+ "application/json": {
886
+ "schema": {
887
+ "$ref": "#/components/schemas/APIError",
888
+ },
889
+ },
890
+ },
891
+ "description": "Bad request",
892
+ },
893
+ "401": {
894
+ "description": "The user must be authenticated",
895
+ },
896
+ "403": {
897
+ "content": {
898
+ "application/json": {
899
+ "schema": {
900
+ "$ref": "#/components/schemas/APIError",
901
+ },
902
+ },
903
+ },
904
+ "description": "The user is not allowed to perform this action on this document",
905
+ },
906
+ "404": {
907
+ "content": {
908
+ "application/json": {
909
+ "schema": {
910
+ "$ref": "#/components/schemas/APIError",
911
+ },
912
+ },
913
+ },
914
+ "description": "Document not found",
915
+ },
916
+ "405": {
917
+ "content": {
918
+ "application/json": {
919
+ "schema": {
920
+ "$ref": "#/components/schemas/APIError",
921
+ },
922
+ },
923
+ },
924
+ "description": "The user is not allowed to perform this action on any document",
925
+ },
926
+ },
927
+ "tags": [
928
+ "foods",
929
+ ],
930
+ },
931
+ },
932
+ "/food/{id}": {
933
+ "delete": {
934
+ "parameters": [
935
+ {
936
+ "in": "path",
937
+ "name": "id",
938
+ "required": true,
939
+ "schema": {
940
+ "type": "string",
941
+ },
942
+ },
943
+ ],
944
+ "responses": {
945
+ "204": {
946
+ "description": "Successful delete",
947
+ },
948
+ "400": {
949
+ "content": {
950
+ "application/json": {
951
+ "schema": {
952
+ "$ref": "#/components/schemas/APIError",
953
+ },
954
+ },
955
+ },
956
+ "description": "Bad request",
957
+ },
958
+ "401": {
959
+ "description": "The user must be authenticated",
960
+ },
961
+ "403": {
962
+ "content": {
963
+ "application/json": {
964
+ "schema": {
965
+ "$ref": "#/components/schemas/APIError",
966
+ },
967
+ },
968
+ },
969
+ "description": "The user is not allowed to perform this action on this document",
970
+ },
971
+ "404": {
972
+ "content": {
973
+ "application/json": {
974
+ "schema": {
975
+ "$ref": "#/components/schemas/APIError",
976
+ },
977
+ },
978
+ },
979
+ "description": "Document not found",
980
+ },
981
+ "405": {
982
+ "content": {
983
+ "application/json": {
984
+ "schema": {
985
+ "$ref": "#/components/schemas/APIError",
986
+ },
987
+ },
988
+ },
989
+ "description": "The user is not allowed to perform this action on any document",
990
+ },
991
+ },
992
+ "tags": [
993
+ "foods",
994
+ ],
995
+ },
996
+ "get": {
997
+ "parameters": [
998
+ {
999
+ "in": "path",
1000
+ "name": "id",
1001
+ "required": true,
1002
+ "schema": {
1003
+ "type": "string",
1004
+ },
1005
+ },
1006
+ ],
1007
+ "responses": {
1008
+ "200": {
1009
+ "content": {
1010
+ "application/json": {
1011
+ "schema": {
1012
+ "properties": {
1013
+ "_id": {
1014
+ "type": "string",
1015
+ },
1016
+ "calories": {
1017
+ "type": "number",
1018
+ },
1019
+ "categories": {
1020
+ "items": {
1021
+ "properties": {
1022
+ "_id": {
1023
+ "type": "string",
1024
+ },
1025
+ "created": {
1026
+ "format": "date-time",
1027
+ "type": "string",
1028
+ },
1029
+ "name": {
1030
+ "type": "string",
1031
+ },
1032
+ "show": {
1033
+ "type": "boolean",
1034
+ },
1035
+ "updated": {
1036
+ "format": "date-time",
1037
+ "type": "string",
1038
+ },
1039
+ },
1040
+ "required": [],
1041
+ "type": "object",
1042
+ },
1043
+ "type": "array",
1044
+ },
1045
+ "created": {
1046
+ "format": "date-time",
1047
+ "type": "string",
1048
+ },
1049
+ "description": {
1050
+ "type": "any",
1051
+ },
1052
+ "eatenBy": {
1053
+ "items": {
1054
+ "properties": {
1055
+ "__t": {
1056
+ "type": "string",
1057
+ },
1058
+ "_id": {
1059
+ "type": "string",
1060
+ },
1061
+ "admin": {
1062
+ "default": false,
1063
+ "type": "boolean",
1064
+ },
1065
+ "age": {
1066
+ "type": "number",
1067
+ },
1068
+ "attempts": {
1069
+ "default": 0,
1070
+ "type": "number",
1071
+ },
1072
+ "created": {
1073
+ "format": "date-time",
1074
+ "type": "string",
1075
+ },
1076
+ "disabled": {
1077
+ "default": false,
1078
+ "description": "When a user is set to disable, all requests will return a 401",
1079
+ "type": "boolean",
1080
+ },
1081
+ "email": {
1082
+ "type": "string",
1083
+ },
1084
+ "hash": {
1085
+ "type": "string",
1086
+ },
1087
+ "last": {
1088
+ "format": "date-time",
1089
+ "type": "string",
1090
+ },
1091
+ "name": {
1092
+ "type": "string",
1093
+ },
1094
+ "salt": {
1095
+ "type": "string",
1096
+ },
1097
+ "updated": {
1098
+ "format": "date-time",
1099
+ "type": "string",
1100
+ },
1101
+ "username": {
1102
+ "type": "string",
1103
+ },
1104
+ },
1105
+ "type": "object",
1106
+ },
1107
+ "type": "array",
1108
+ },
1109
+ "expiration": {
1110
+ "type": "dateonly",
1111
+ },
1112
+ "foo": {
1113
+ "type": "string",
1114
+ },
1115
+ "hidden": {
1116
+ "type": "boolean",
1117
+ },
1118
+ "lastEatenWith": {
1119
+ "additionalProperties": {
1120
+ "format": "date-time",
1121
+ "type": "string",
1122
+ },
1123
+ "type": "object",
1124
+ },
1125
+ "likesIds": {
1126
+ "items": {
1127
+ "properties": {
1128
+ "_id": {
1129
+ "type": "string",
1130
+ },
1131
+ "likes": {
1132
+ "type": "boolean",
1133
+ },
1134
+ "userId": {
1135
+ "type": "string",
1136
+ },
1137
+ },
1138
+ "required": [],
1139
+ "type": "object",
1140
+ },
1141
+ "type": "array",
1142
+ },
1143
+ "name": {
1144
+ "type": "string",
1145
+ },
1146
+ "ownerId": {
1147
+ "properties": {
1148
+ "__t": {
1149
+ "type": "string",
1150
+ },
1151
+ "_id": {
1152
+ "type": "string",
1153
+ },
1154
+ "admin": {
1155
+ "default": false,
1156
+ "type": "boolean",
1157
+ },
1158
+ "age": {
1159
+ "type": "number",
1160
+ },
1161
+ "attempts": {
1162
+ "default": 0,
1163
+ "type": "number",
1164
+ },
1165
+ "created": {
1166
+ "format": "date-time",
1167
+ "type": "string",
1168
+ },
1169
+ "disabled": {
1170
+ "default": false,
1171
+ "description": "When a user is set to disable, all requests will return a 401",
1172
+ "type": "boolean",
1173
+ },
1174
+ "email": {
1175
+ "type": "string",
1176
+ },
1177
+ "hash": {
1178
+ "type": "string",
1179
+ },
1180
+ "last": {
1181
+ "format": "date-time",
1182
+ "type": "string",
1183
+ },
1184
+ "name": {
1185
+ "type": "string",
1186
+ },
1187
+ "salt": {
1188
+ "type": "string",
1189
+ },
1190
+ "updated": {
1191
+ "format": "date-time",
1192
+ "type": "string",
1193
+ },
1194
+ "username": {
1195
+ "type": "string",
1196
+ },
1197
+ },
1198
+ "type": "object",
1199
+ },
1200
+ "source": {
1201
+ "properties": {
1202
+ "dateAdded": {
1203
+ "type": "string",
1204
+ },
1205
+ "href": {
1206
+ "type": "string",
1207
+ },
1208
+ "name": {
1209
+ "type": "string",
1210
+ },
1211
+ },
1212
+ "type": "object",
1213
+ },
1214
+ "tags": {
1215
+ "items": {
1216
+ "type": "string",
1217
+ },
1218
+ "type": "array",
1219
+ },
1220
+ },
1221
+ "required": [
1222
+ "likesIds",
1223
+ "_id",
1224
+ "created",
1225
+ "updated",
1226
+ ],
1227
+ "type": "object",
1228
+ },
1229
+ },
1230
+ },
1231
+ "description": "Successful read",
1232
+ },
1233
+ "400": {
1234
+ "content": {
1235
+ "application/json": {
1236
+ "schema": {
1237
+ "$ref": "#/components/schemas/APIError",
1238
+ },
1239
+ },
1240
+ },
1241
+ "description": "Bad request",
1242
+ },
1243
+ "401": {
1244
+ "description": "The user must be authenticated",
1245
+ },
1246
+ "403": {
1247
+ "content": {
1248
+ "application/json": {
1249
+ "schema": {
1250
+ "$ref": "#/components/schemas/APIError",
1251
+ },
1252
+ },
1253
+ },
1254
+ "description": "The user is not allowed to perform this action on this document",
1255
+ },
1256
+ "404": {
1257
+ "content": {
1258
+ "application/json": {
1259
+ "schema": {
1260
+ "$ref": "#/components/schemas/APIError",
1261
+ },
1262
+ },
1263
+ },
1264
+ "description": "Document not found",
1265
+ },
1266
+ "405": {
1267
+ "content": {
1268
+ "application/json": {
1269
+ "schema": {
1270
+ "$ref": "#/components/schemas/APIError",
1271
+ },
1272
+ },
1273
+ },
1274
+ "description": "The user is not allowed to perform this action on any document",
1275
+ },
1276
+ },
1277
+ "tags": [
1278
+ "foods",
1279
+ ],
1280
+ },
1281
+ "patch": {
1282
+ "parameters": [
1283
+ {
1284
+ "in": "path",
1285
+ "name": "id",
1286
+ "required": true,
1287
+ "schema": {
1288
+ "type": "string",
1289
+ },
1290
+ },
1291
+ ],
1292
+ "requestBody": {
1293
+ "content": {
1294
+ "application/json": {
1295
+ "schema": {
1296
+ "properties": {
1297
+ "_id": {
1298
+ "type": "string",
1299
+ },
1300
+ "calories": {
1301
+ "type": "number",
1302
+ },
1303
+ "categories": {
1304
+ "items": {
1305
+ "properties": {
1306
+ "_id": {
1307
+ "type": "string",
1308
+ },
1309
+ "created": {
1310
+ "format": "date-time",
1311
+ "type": "string",
1312
+ },
1313
+ "name": {
1314
+ "type": "string",
1315
+ },
1316
+ "show": {
1317
+ "type": "boolean",
1318
+ },
1319
+ "updated": {
1320
+ "format": "date-time",
1321
+ "type": "string",
1322
+ },
1323
+ },
1324
+ "required": [],
1325
+ "type": "object",
1326
+ },
1327
+ "type": "array",
1328
+ },
1329
+ "created": {
1330
+ "format": "date-time",
1331
+ "type": "string",
1332
+ },
1333
+ "description": {
1334
+ "type": "any",
1335
+ },
1336
+ "eatenBy": {
1337
+ "items": {
1338
+ "properties": {
1339
+ "__t": {
1340
+ "type": "string",
1341
+ },
1342
+ "_id": {
1343
+ "type": "string",
1344
+ },
1345
+ "admin": {
1346
+ "default": false,
1347
+ "type": "boolean",
1348
+ },
1349
+ "age": {
1350
+ "type": "number",
1351
+ },
1352
+ "attempts": {
1353
+ "default": 0,
1354
+ "type": "number",
1355
+ },
1356
+ "created": {
1357
+ "format": "date-time",
1358
+ "type": "string",
1359
+ },
1360
+ "disabled": {
1361
+ "default": false,
1362
+ "description": "When a user is set to disable, all requests will return a 401",
1363
+ "type": "boolean",
1364
+ },
1365
+ "email": {
1366
+ "type": "string",
1367
+ },
1368
+ "hash": {
1369
+ "type": "string",
1370
+ },
1371
+ "last": {
1372
+ "format": "date-time",
1373
+ "type": "string",
1374
+ },
1375
+ "name": {
1376
+ "type": "string",
1377
+ },
1378
+ "salt": {
1379
+ "type": "string",
1380
+ },
1381
+ "updated": {
1382
+ "format": "date-time",
1383
+ "type": "string",
1384
+ },
1385
+ "username": {
1386
+ "type": "string",
1387
+ },
1388
+ },
1389
+ "type": "object",
1390
+ },
1391
+ "type": "array",
1392
+ },
1393
+ "expiration": {
1394
+ "type": "dateonly",
1395
+ },
1396
+ "foo": {
1397
+ "type": "string",
1398
+ },
1399
+ "hidden": {
1400
+ "type": "boolean",
1401
+ },
1402
+ "lastEatenWith": {
1403
+ "additionalProperties": {
1404
+ "format": "date-time",
1405
+ "type": "string",
1406
+ },
1407
+ "type": "object",
1408
+ },
1409
+ "likesIds": {
1410
+ "items": {
1411
+ "properties": {
1412
+ "_id": {
1413
+ "type": "string",
1414
+ },
1415
+ "likes": {
1416
+ "type": "boolean",
1417
+ },
1418
+ "userId": {
1419
+ "type": "string",
1420
+ },
1421
+ },
1422
+ "required": [],
1423
+ "type": "object",
1424
+ },
1425
+ "type": "array",
1426
+ },
1427
+ "name": {
1428
+ "type": "string",
1429
+ },
1430
+ "ownerId": {
1431
+ "properties": {
1432
+ "__t": {
1433
+ "type": "string",
1434
+ },
1435
+ "_id": {
1436
+ "type": "string",
1437
+ },
1438
+ "admin": {
1439
+ "default": false,
1440
+ "type": "boolean",
1441
+ },
1442
+ "age": {
1443
+ "type": "number",
1444
+ },
1445
+ "attempts": {
1446
+ "default": 0,
1447
+ "type": "number",
1448
+ },
1449
+ "created": {
1450
+ "format": "date-time",
1451
+ "type": "string",
1452
+ },
1453
+ "disabled": {
1454
+ "default": false,
1455
+ "description": "When a user is set to disable, all requests will return a 401",
1456
+ "type": "boolean",
1457
+ },
1458
+ "email": {
1459
+ "type": "string",
1460
+ },
1461
+ "hash": {
1462
+ "type": "string",
1463
+ },
1464
+ "last": {
1465
+ "format": "date-time",
1466
+ "type": "string",
1467
+ },
1468
+ "name": {
1469
+ "type": "string",
1470
+ },
1471
+ "salt": {
1472
+ "type": "string",
1473
+ },
1474
+ "updated": {
1475
+ "format": "date-time",
1476
+ "type": "string",
1477
+ },
1478
+ "username": {
1479
+ "type": "string",
1480
+ },
1481
+ },
1482
+ "type": "object",
1483
+ },
1484
+ "source": {
1485
+ "properties": {
1486
+ "dateAdded": {
1487
+ "type": "string",
1488
+ },
1489
+ "href": {
1490
+ "type": "string",
1491
+ },
1492
+ "name": {
1493
+ "type": "string",
1494
+ },
1495
+ },
1496
+ "type": "object",
1497
+ },
1498
+ "tags": {
1499
+ "items": {
1500
+ "type": "string",
1501
+ },
1502
+ "type": "array",
1503
+ },
1504
+ },
1505
+ "type": "object",
1506
+ },
1507
+ },
1508
+ },
1509
+ "required": true,
1510
+ },
1511
+ "responses": {
1512
+ "200": {
1513
+ "content": {
1514
+ "application/json": {
1515
+ "schema": {
1516
+ "properties": {
1517
+ "_id": {
1518
+ "type": "string",
1519
+ },
1520
+ "calories": {
1521
+ "type": "number",
1522
+ },
1523
+ "categories": {
1524
+ "items": {
1525
+ "properties": {
1526
+ "_id": {
1527
+ "type": "string",
1528
+ },
1529
+ "created": {
1530
+ "format": "date-time",
1531
+ "type": "string",
1532
+ },
1533
+ "name": {
1534
+ "type": "string",
1535
+ },
1536
+ "show": {
1537
+ "type": "boolean",
1538
+ },
1539
+ "updated": {
1540
+ "format": "date-time",
1541
+ "type": "string",
1542
+ },
1543
+ },
1544
+ "required": [],
1545
+ "type": "object",
1546
+ },
1547
+ "type": "array",
1548
+ },
1549
+ "created": {
1550
+ "format": "date-time",
1551
+ "type": "string",
1552
+ },
1553
+ "description": {
1554
+ "type": "any",
1555
+ },
1556
+ "eatenBy": {
1557
+ "items": {
1558
+ "properties": {
1559
+ "__t": {
1560
+ "type": "string",
1561
+ },
1562
+ "_id": {
1563
+ "type": "string",
1564
+ },
1565
+ "admin": {
1566
+ "default": false,
1567
+ "type": "boolean",
1568
+ },
1569
+ "age": {
1570
+ "type": "number",
1571
+ },
1572
+ "attempts": {
1573
+ "default": 0,
1574
+ "type": "number",
1575
+ },
1576
+ "created": {
1577
+ "format": "date-time",
1578
+ "type": "string",
1579
+ },
1580
+ "disabled": {
1581
+ "default": false,
1582
+ "description": "When a user is set to disable, all requests will return a 401",
1583
+ "type": "boolean",
1584
+ },
1585
+ "email": {
1586
+ "type": "string",
1587
+ },
1588
+ "hash": {
1589
+ "type": "string",
1590
+ },
1591
+ "last": {
1592
+ "format": "date-time",
1593
+ "type": "string",
1594
+ },
1595
+ "name": {
1596
+ "type": "string",
1597
+ },
1598
+ "salt": {
1599
+ "type": "string",
1600
+ },
1601
+ "updated": {
1602
+ "format": "date-time",
1603
+ "type": "string",
1604
+ },
1605
+ "username": {
1606
+ "type": "string",
1607
+ },
1608
+ },
1609
+ "type": "object",
1610
+ },
1611
+ "type": "array",
1612
+ },
1613
+ "expiration": {
1614
+ "type": "dateonly",
1615
+ },
1616
+ "foo": {
1617
+ "type": "string",
1618
+ },
1619
+ "hidden": {
1620
+ "type": "boolean",
1621
+ },
1622
+ "lastEatenWith": {
1623
+ "additionalProperties": {
1624
+ "format": "date-time",
1625
+ "type": "string",
1626
+ },
1627
+ "type": "object",
1628
+ },
1629
+ "likesIds": {
1630
+ "items": {
1631
+ "properties": {
1632
+ "_id": {
1633
+ "type": "string",
1634
+ },
1635
+ "likes": {
1636
+ "type": "boolean",
1637
+ },
1638
+ "userId": {
1639
+ "type": "string",
1640
+ },
1641
+ },
1642
+ "required": [],
1643
+ "type": "object",
1644
+ },
1645
+ "type": "array",
1646
+ },
1647
+ "name": {
1648
+ "type": "string",
1649
+ },
1650
+ "ownerId": {
1651
+ "properties": {
1652
+ "__t": {
1653
+ "type": "string",
1654
+ },
1655
+ "_id": {
1656
+ "type": "string",
1657
+ },
1658
+ "admin": {
1659
+ "default": false,
1660
+ "type": "boolean",
1661
+ },
1662
+ "age": {
1663
+ "type": "number",
1664
+ },
1665
+ "attempts": {
1666
+ "default": 0,
1667
+ "type": "number",
1668
+ },
1669
+ "created": {
1670
+ "format": "date-time",
1671
+ "type": "string",
1672
+ },
1673
+ "disabled": {
1674
+ "default": false,
1675
+ "description": "When a user is set to disable, all requests will return a 401",
1676
+ "type": "boolean",
1677
+ },
1678
+ "email": {
1679
+ "type": "string",
1680
+ },
1681
+ "hash": {
1682
+ "type": "string",
1683
+ },
1684
+ "last": {
1685
+ "format": "date-time",
1686
+ "type": "string",
1687
+ },
1688
+ "name": {
1689
+ "type": "string",
1690
+ },
1691
+ "salt": {
1692
+ "type": "string",
1693
+ },
1694
+ "updated": {
1695
+ "format": "date-time",
1696
+ "type": "string",
1697
+ },
1698
+ "username": {
1699
+ "type": "string",
1700
+ },
1701
+ },
1702
+ "type": "object",
1703
+ },
1704
+ "source": {
1705
+ "properties": {
1706
+ "dateAdded": {
1707
+ "type": "string",
1708
+ },
1709
+ "href": {
1710
+ "type": "string",
1711
+ },
1712
+ "name": {
1713
+ "type": "string",
1714
+ },
1715
+ },
1716
+ "type": "object",
1717
+ },
1718
+ "tags": {
1719
+ "items": {
1720
+ "type": "string",
1721
+ },
1722
+ "type": "array",
1723
+ },
1724
+ },
1725
+ "required": [
1726
+ "likesIds",
1727
+ "_id",
1728
+ "created",
1729
+ "updated",
1730
+ ],
1731
+ "type": "object",
1732
+ },
1733
+ },
1734
+ },
1735
+ "description": "Successful update",
1736
+ },
1737
+ "400": {
1738
+ "content": {
1739
+ "application/json": {
1740
+ "schema": {
1741
+ "$ref": "#/components/schemas/APIError",
1742
+ },
1743
+ },
1744
+ },
1745
+ "description": "Bad request",
1746
+ },
1747
+ "401": {
1748
+ "description": "The user must be authenticated",
1749
+ },
1750
+ "403": {
1751
+ "content": {
1752
+ "application/json": {
1753
+ "schema": {
1754
+ "$ref": "#/components/schemas/APIError",
1755
+ },
1756
+ },
1757
+ },
1758
+ "description": "The user is not allowed to perform this action on this document",
1759
+ },
1760
+ "404": {
1761
+ "content": {
1762
+ "application/json": {
1763
+ "schema": {
1764
+ "$ref": "#/components/schemas/APIError",
1765
+ },
1766
+ },
1767
+ },
1768
+ "description": "Document not found",
1769
+ },
1770
+ "405": {
1771
+ "content": {
1772
+ "application/json": {
1773
+ "schema": {
1774
+ "$ref": "#/components/schemas/APIError",
1775
+ },
1776
+ },
1777
+ },
1778
+ "description": "The user is not allowed to perform this action on any document",
1779
+ },
1780
+ },
1781
+ "tags": [
1782
+ "foods",
1783
+ ],
1784
+ },
1785
+ },
1786
+ },
1787
+ }
1788
+ `;
1789
+
1790
+ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
1791
+ {
1792
+ "components": {
1793
+ "schemas": {
1794
+ "APIError": {
1795
+ "properties": {
1796
+ "code": {
1797
+ "description": "An application-specific error code, expressed as a string value.",
1798
+ "type": "string",
1799
+ },
1800
+ "detail": {
1801
+ "description": "A human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.",
1802
+ "type": "string",
1803
+ },
1804
+ "id": {
1805
+ "description": "A unique identifier for this particular occurrence of the problem.",
1806
+ "type": "string",
1807
+ },
1808
+ "links": {
1809
+ "properties": {
1810
+ "about": {
1811
+ "description": "A link that leads to further details about this particular occurrence of the problem. When derefenced, this URI SHOULD return a human-readable description of the error.",
1812
+ "type": "string",
1813
+ },
1814
+ "type": {
1815
+ "description": "A link that identifies the type of error that this particular error is an instance of. This URI SHOULD be dereferencable to a human-readable explanation of the general error.",
1816
+ "type": "string",
1817
+ },
1818
+ },
1819
+ "type": "object",
1820
+ },
1821
+ "meta": {
1822
+ "description": "A meta object containing non-standard meta-information about the error.",
1823
+ "type": "object",
1824
+ },
1825
+ "source": {
1826
+ "properties": {
1827
+ "header": {
1828
+ "description": "A string indicating the name of a single request header which caused the error.",
1829
+ "type": "string",
1830
+ },
1831
+ "parameter": {
1832
+ "description": "A string indicating which URI query parameter caused the error.",
1833
+ "type": "string",
1834
+ },
1835
+ "pointer": {
1836
+ "description": "A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].",
1837
+ "type": "string",
1838
+ },
1839
+ },
1840
+ "type": "object",
1841
+ },
1842
+ "status": {
1843
+ "description": "The HTTP status code applicable to this problem, expressed as a string value.",
1844
+ "type": "number",
1845
+ },
1846
+ "title": {
1847
+ "description": "The error message",
1848
+ "type": "string",
1849
+ },
1850
+ },
1851
+ "type": "object",
1852
+ },
1853
+ },
1854
+ },
1855
+ "info": {
1856
+ "description": "Generated docs from an Express api",
1857
+ "title": "Express Application",
1858
+ "version": "1.0.0",
1859
+ },
1860
+ "openapi": "3.0.0",
1861
+ "paths": {
1862
+ "/food/": {
1863
+ "get": {
1864
+ "parameters": [
1865
+ {
1866
+ "in": "query",
1867
+ "name": "_id",
1868
+ "schema": {
1869
+ "properties": {
1870
+ "$in": {
1871
+ "items": {
1872
+ "type": "string",
1873
+ },
1874
+ "type": "array",
1875
+ },
1876
+ },
1877
+ "type": "object",
1878
+ },
1879
+ },
1880
+ {
1881
+ "in": "query",
1882
+ "name": "calories",
1883
+ "schema": {
1884
+ "oneOf": [
1885
+ {
1886
+ "type": "number",
1887
+ },
1888
+ {
1889
+ "properties": {
1890
+ "$gt": {
1891
+ "type": "number",
1892
+ },
1893
+ "$gte": {
1894
+ "type": "number",
1895
+ },
1896
+ "$lt": {
1897
+ "type": "number",
1898
+ },
1899
+ "$lte": {
1900
+ "type": "number",
1901
+ },
1902
+ },
1903
+ "type": "object",
1904
+ },
1905
+ ],
1906
+ },
1907
+ },
1908
+ {
1909
+ "in": "query",
1910
+ "name": "page",
1911
+ "schema": {
1912
+ "type": "number",
1913
+ },
1914
+ },
1915
+ {
1916
+ "in": "query",
1917
+ "name": "sort",
1918
+ "schema": {
1919
+ "type": "string",
1920
+ },
1921
+ },
1922
+ {
1923
+ "in": "query",
1924
+ "name": "limit",
1925
+ "schema": {
1926
+ "type": "number",
1927
+ },
1928
+ },
1929
+ ],
1930
+ "responses": {
1931
+ "200": {
1932
+ "content": {
1933
+ "application/json": {
1934
+ "schema": {
1935
+ "properties": {
1936
+ "data": {
1937
+ "items": {
1938
+ "properties": {
1939
+ "_id": {
1940
+ "type": "string",
1941
+ },
1942
+ "calories": {
1943
+ "type": "number",
1944
+ },
1945
+ "categories": {
1946
+ "items": {
1947
+ "properties": {
1948
+ "_id": {
1949
+ "type": "string",
1950
+ },
1951
+ "created": {
1952
+ "format": "date-time",
1953
+ "type": "string",
1954
+ },
1955
+ "name": {
1956
+ "type": "string",
1957
+ },
1958
+ "show": {
1959
+ "type": "boolean",
1960
+ },
1961
+ "updated": {
1962
+ "format": "date-time",
1963
+ "type": "string",
1964
+ },
1965
+ },
1966
+ "required": [],
1967
+ "type": "object",
1968
+ },
1969
+ "type": "array",
1970
+ },
1971
+ "created": {
1972
+ "format": "date-time",
1973
+ "type": "string",
1974
+ },
1975
+ "description": {
1976
+ "type": "any",
1977
+ },
1978
+ "eatenBy": {
1979
+ "items": {
1980
+ "properties": {
1981
+ "__t": {
1982
+ "type": "string",
1983
+ },
1984
+ "_id": {
1985
+ "type": "string",
1986
+ },
1987
+ "admin": {
1988
+ "default": false,
1989
+ "type": "boolean",
1990
+ },
1991
+ "age": {
1992
+ "type": "number",
1993
+ },
1994
+ "attempts": {
1995
+ "default": 0,
1996
+ "type": "number",
1997
+ },
1998
+ "created": {
1999
+ "format": "date-time",
2000
+ "type": "string",
2001
+ },
2002
+ "disabled": {
2003
+ "default": false,
2004
+ "description": "When a user is set to disable, all requests will return a 401",
2005
+ "type": "boolean",
2006
+ },
2007
+ "email": {
2008
+ "type": "string",
2009
+ },
2010
+ "hash": {
2011
+ "type": "string",
2012
+ },
2013
+ "last": {
2014
+ "format": "date-time",
2015
+ "type": "string",
2016
+ },
2017
+ "name": {
2018
+ "type": "string",
2019
+ },
2020
+ "salt": {
2021
+ "type": "string",
2022
+ },
2023
+ "updated": {
2024
+ "format": "date-time",
2025
+ "type": "string",
2026
+ },
2027
+ "username": {
2028
+ "type": "string",
2029
+ },
2030
+ },
2031
+ "type": "object",
2032
+ },
2033
+ "type": "array",
2034
+ },
2035
+ "expiration": {
2036
+ "type": "dateonly",
2037
+ },
2038
+ "foo": {
2039
+ "type": "string",
2040
+ },
2041
+ "hidden": {
2042
+ "type": "boolean",
2043
+ },
2044
+ "lastEatenWith": {
2045
+ "additionalProperties": {
2046
+ "format": "date-time",
2047
+ "type": "string",
2048
+ },
2049
+ "type": "object",
2050
+ },
2051
+ "likesIds": {
2052
+ "items": {
2053
+ "properties": {
2054
+ "_id": {
2055
+ "type": "string",
2056
+ },
2057
+ "likes": {
2058
+ "type": "boolean",
2059
+ },
2060
+ "userId": {
2061
+ "type": "string",
2062
+ },
2063
+ },
2064
+ "required": [],
2065
+ "type": "object",
2066
+ },
2067
+ "type": "array",
2068
+ },
2069
+ "name": {
2070
+ "type": "string",
2071
+ },
2072
+ "ownerId": {
2073
+ "properties": {
2074
+ "__t": {
2075
+ "type": "string",
2076
+ },
2077
+ "_id": {
2078
+ "type": "string",
2079
+ },
2080
+ "admin": {
2081
+ "default": false,
2082
+ "type": "boolean",
2083
+ },
2084
+ "age": {
2085
+ "type": "number",
2086
+ },
2087
+ "attempts": {
2088
+ "default": 0,
2089
+ "type": "number",
2090
+ },
2091
+ "created": {
2092
+ "format": "date-time",
2093
+ "type": "string",
2094
+ },
2095
+ "disabled": {
2096
+ "default": false,
2097
+ "description": "When a user is set to disable, all requests will return a 401",
2098
+ "type": "boolean",
2099
+ },
2100
+ "email": {
2101
+ "type": "string",
2102
+ },
2103
+ "hash": {
2104
+ "type": "string",
2105
+ },
2106
+ "last": {
2107
+ "format": "date-time",
2108
+ "type": "string",
2109
+ },
2110
+ "name": {
2111
+ "type": "string",
2112
+ },
2113
+ "salt": {
2114
+ "type": "string",
2115
+ },
2116
+ "updated": {
2117
+ "format": "date-time",
2118
+ "type": "string",
2119
+ },
2120
+ "username": {
2121
+ "type": "string",
2122
+ },
2123
+ },
2124
+ "type": "object",
2125
+ },
2126
+ "source": {
2127
+ "properties": {
2128
+ "dateAdded": {
2129
+ "type": "string",
2130
+ },
2131
+ "href": {
2132
+ "type": "string",
2133
+ },
2134
+ "name": {
2135
+ "type": "string",
2136
+ },
2137
+ },
2138
+ "type": "object",
2139
+ },
2140
+ "tags": {
2141
+ "items": {
2142
+ "type": "string",
2143
+ },
2144
+ "type": "array",
2145
+ },
2146
+ },
2147
+ "required": [
2148
+ "likesIds",
2149
+ "_id",
2150
+ "created",
2151
+ "updated",
2152
+ ],
2153
+ "type": "object",
2154
+ },
2155
+ "type": "array",
2156
+ },
2157
+ "limit": {
2158
+ "type": "number",
2159
+ },
2160
+ "more": {
2161
+ "type": "boolean",
2162
+ },
2163
+ "page": {
2164
+ "type": "number",
2165
+ },
2166
+ "total": {
2167
+ "type": "number",
2168
+ },
2169
+ },
2170
+ "type": "object",
2171
+ },
2172
+ },
2173
+ },
2174
+ "description": "Successful list",
2175
+ },
2176
+ "400": {
2177
+ "content": {
2178
+ "application/json": {
2179
+ "schema": {
2180
+ "$ref": "#/components/schemas/APIError",
2181
+ },
2182
+ },
2183
+ },
2184
+ "description": "Bad request",
2185
+ },
2186
+ "401": {
2187
+ "description": "The user must be authenticated",
2188
+ },
2189
+ "403": {
2190
+ "content": {
2191
+ "application/json": {
2192
+ "schema": {
2193
+ "$ref": "#/components/schemas/APIError",
2194
+ },
2195
+ },
2196
+ },
2197
+ "description": "The user is not allowed to perform this action on this document",
2198
+ },
2199
+ "404": {
2200
+ "content": {
2201
+ "application/json": {
2202
+ "schema": {
2203
+ "$ref": "#/components/schemas/APIError",
2204
+ },
2205
+ },
2206
+ },
2207
+ "description": "Document not found",
2208
+ },
2209
+ "405": {
2210
+ "content": {
2211
+ "application/json": {
2212
+ "schema": {
2213
+ "$ref": "#/components/schemas/APIError",
2214
+ },
2215
+ },
2216
+ },
2217
+ "description": "The user is not allowed to perform this action on any document",
2218
+ },
2219
+ },
2220
+ "tags": [
2221
+ "foods",
2222
+ ],
2223
+ },
2224
+ "post": {
2225
+ "requestBody": {
2226
+ "content": {
2227
+ "application/json": {
2228
+ "schema": {
2229
+ "properties": {
2230
+ "_id": {
2231
+ "type": "string",
2232
+ },
2233
+ "calories": {
2234
+ "type": "number",
2235
+ },
2236
+ "categories": {
2237
+ "items": {
2238
+ "properties": {
2239
+ "_id": {
2240
+ "type": "string",
2241
+ },
2242
+ "created": {
2243
+ "format": "date-time",
2244
+ "type": "string",
2245
+ },
2246
+ "name": {
2247
+ "type": "string",
2248
+ },
2249
+ "show": {
2250
+ "type": "boolean",
2251
+ },
2252
+ "updated": {
2253
+ "format": "date-time",
2254
+ "type": "string",
2255
+ },
2256
+ },
2257
+ "required": [],
2258
+ "type": "object",
2259
+ },
2260
+ "type": "array",
2261
+ },
2262
+ "created": {
2263
+ "format": "date-time",
2264
+ "type": "string",
2265
+ },
2266
+ "description": {
2267
+ "type": "any",
2268
+ },
2269
+ "eatenBy": {
2270
+ "items": {
2271
+ "properties": {
2272
+ "__t": {
2273
+ "type": "string",
2274
+ },
2275
+ "_id": {
2276
+ "type": "string",
2277
+ },
2278
+ "admin": {
2279
+ "default": false,
2280
+ "type": "boolean",
2281
+ },
2282
+ "age": {
2283
+ "type": "number",
2284
+ },
2285
+ "attempts": {
2286
+ "default": 0,
2287
+ "type": "number",
2288
+ },
2289
+ "created": {
2290
+ "format": "date-time",
2291
+ "type": "string",
2292
+ },
2293
+ "disabled": {
2294
+ "default": false,
2295
+ "description": "When a user is set to disable, all requests will return a 401",
2296
+ "type": "boolean",
2297
+ },
2298
+ "email": {
2299
+ "type": "string",
2300
+ },
2301
+ "hash": {
2302
+ "type": "string",
2303
+ },
2304
+ "last": {
2305
+ "format": "date-time",
2306
+ "type": "string",
2307
+ },
2308
+ "name": {
2309
+ "type": "string",
2310
+ },
2311
+ "salt": {
2312
+ "type": "string",
2313
+ },
2314
+ "updated": {
2315
+ "format": "date-time",
2316
+ "type": "string",
2317
+ },
2318
+ "username": {
2319
+ "type": "string",
2320
+ },
2321
+ },
2322
+ "type": "object",
2323
+ },
2324
+ "type": "array",
2325
+ },
2326
+ "expiration": {
2327
+ "type": "dateonly",
2328
+ },
2329
+ "foo": {
2330
+ "type": "string",
2331
+ },
2332
+ "hidden": {
2333
+ "type": "boolean",
2334
+ },
2335
+ "lastEatenWith": {
2336
+ "additionalProperties": {
2337
+ "format": "date-time",
2338
+ "type": "string",
2339
+ },
2340
+ "type": "object",
2341
+ },
2342
+ "likesIds": {
2343
+ "items": {
2344
+ "properties": {
2345
+ "_id": {
2346
+ "type": "string",
2347
+ },
2348
+ "likes": {
2349
+ "type": "boolean",
2350
+ },
2351
+ "userId": {
2352
+ "type": "string",
2353
+ },
2354
+ },
2355
+ "required": [],
2356
+ "type": "object",
2357
+ },
2358
+ "type": "array",
2359
+ },
2360
+ "name": {
2361
+ "type": "string",
2362
+ },
2363
+ "ownerId": {
2364
+ "properties": {
2365
+ "__t": {
2366
+ "type": "string",
2367
+ },
2368
+ "_id": {
2369
+ "type": "string",
2370
+ },
2371
+ "admin": {
2372
+ "default": false,
2373
+ "type": "boolean",
2374
+ },
2375
+ "age": {
2376
+ "type": "number",
2377
+ },
2378
+ "attempts": {
2379
+ "default": 0,
2380
+ "type": "number",
2381
+ },
2382
+ "created": {
2383
+ "format": "date-time",
2384
+ "type": "string",
2385
+ },
2386
+ "disabled": {
2387
+ "default": false,
2388
+ "description": "When a user is set to disable, all requests will return a 401",
2389
+ "type": "boolean",
2390
+ },
2391
+ "email": {
2392
+ "type": "string",
2393
+ },
2394
+ "hash": {
2395
+ "type": "string",
2396
+ },
2397
+ "last": {
2398
+ "format": "date-time",
2399
+ "type": "string",
2400
+ },
2401
+ "name": {
2402
+ "type": "string",
2403
+ },
2404
+ "salt": {
2405
+ "type": "string",
2406
+ },
2407
+ "updated": {
2408
+ "format": "date-time",
2409
+ "type": "string",
2410
+ },
2411
+ "username": {
2412
+ "type": "string",
2413
+ },
2414
+ },
2415
+ "type": "object",
2416
+ },
2417
+ "source": {
2418
+ "properties": {
2419
+ "dateAdded": {
2420
+ "type": "string",
2421
+ },
2422
+ "href": {
2423
+ "type": "string",
2424
+ },
2425
+ "name": {
2426
+ "type": "string",
2427
+ },
2428
+ },
2429
+ "type": "object",
2430
+ },
2431
+ "tags": {
2432
+ "items": {
2433
+ "type": "string",
2434
+ },
2435
+ "type": "array",
2436
+ },
2437
+ },
2438
+ "type": "object",
2439
+ },
2440
+ },
2441
+ },
2442
+ "required": true,
2443
+ },
2444
+ "responses": {
2445
+ "201": {
2446
+ "content": {
2447
+ "application/json": {
2448
+ "schema": {
2449
+ "properties": {
2450
+ "_id": {
2451
+ "type": "string",
2452
+ },
2453
+ "calories": {
2454
+ "type": "number",
2455
+ },
2456
+ "categories": {
2457
+ "items": {
2458
+ "properties": {
2459
+ "_id": {
2460
+ "type": "string",
2461
+ },
2462
+ "created": {
2463
+ "format": "date-time",
2464
+ "type": "string",
2465
+ },
2466
+ "name": {
2467
+ "type": "string",
2468
+ },
2469
+ "show": {
2470
+ "type": "boolean",
2471
+ },
2472
+ "updated": {
2473
+ "format": "date-time",
2474
+ "type": "string",
2475
+ },
2476
+ },
2477
+ "required": [],
2478
+ "type": "object",
2479
+ },
2480
+ "type": "array",
2481
+ },
2482
+ "created": {
2483
+ "format": "date-time",
2484
+ "type": "string",
2485
+ },
2486
+ "description": {
2487
+ "type": "any",
2488
+ },
2489
+ "eatenBy": {
2490
+ "items": {
2491
+ "properties": {
2492
+ "__t": {
2493
+ "type": "string",
2494
+ },
2495
+ "_id": {
2496
+ "type": "string",
2497
+ },
2498
+ "admin": {
2499
+ "default": false,
2500
+ "type": "boolean",
2501
+ },
2502
+ "age": {
2503
+ "type": "number",
2504
+ },
2505
+ "attempts": {
2506
+ "default": 0,
2507
+ "type": "number",
2508
+ },
2509
+ "created": {
2510
+ "format": "date-time",
2511
+ "type": "string",
2512
+ },
2513
+ "disabled": {
2514
+ "default": false,
2515
+ "description": "When a user is set to disable, all requests will return a 401",
2516
+ "type": "boolean",
2517
+ },
2518
+ "email": {
2519
+ "type": "string",
2520
+ },
2521
+ "hash": {
2522
+ "type": "string",
2523
+ },
2524
+ "last": {
2525
+ "format": "date-time",
2526
+ "type": "string",
2527
+ },
2528
+ "name": {
2529
+ "type": "string",
2530
+ },
2531
+ "salt": {
2532
+ "type": "string",
2533
+ },
2534
+ "updated": {
2535
+ "format": "date-time",
2536
+ "type": "string",
2537
+ },
2538
+ "username": {
2539
+ "type": "string",
2540
+ },
2541
+ },
2542
+ "type": "object",
2543
+ },
2544
+ "type": "array",
2545
+ },
2546
+ "expiration": {
2547
+ "type": "dateonly",
2548
+ },
2549
+ "foo": {
2550
+ "type": "string",
2551
+ },
2552
+ "hidden": {
2553
+ "type": "boolean",
2554
+ },
2555
+ "lastEatenWith": {
2556
+ "additionalProperties": {
2557
+ "format": "date-time",
2558
+ "type": "string",
2559
+ },
2560
+ "type": "object",
2561
+ },
2562
+ "likesIds": {
2563
+ "items": {
2564
+ "properties": {
2565
+ "_id": {
2566
+ "type": "string",
2567
+ },
2568
+ "likes": {
2569
+ "type": "boolean",
2570
+ },
2571
+ "userId": {
2572
+ "type": "string",
2573
+ },
2574
+ },
2575
+ "required": [],
2576
+ "type": "object",
2577
+ },
2578
+ "type": "array",
2579
+ },
2580
+ "name": {
2581
+ "type": "string",
2582
+ },
2583
+ "ownerId": {
2584
+ "properties": {
2585
+ "__t": {
2586
+ "type": "string",
2587
+ },
2588
+ "_id": {
2589
+ "type": "string",
2590
+ },
2591
+ "admin": {
2592
+ "default": false,
2593
+ "type": "boolean",
2594
+ },
2595
+ "age": {
2596
+ "type": "number",
2597
+ },
2598
+ "attempts": {
2599
+ "default": 0,
2600
+ "type": "number",
2601
+ },
2602
+ "created": {
2603
+ "format": "date-time",
2604
+ "type": "string",
2605
+ },
2606
+ "disabled": {
2607
+ "default": false,
2608
+ "description": "When a user is set to disable, all requests will return a 401",
2609
+ "type": "boolean",
2610
+ },
2611
+ "email": {
2612
+ "type": "string",
2613
+ },
2614
+ "hash": {
2615
+ "type": "string",
2616
+ },
2617
+ "last": {
2618
+ "format": "date-time",
2619
+ "type": "string",
2620
+ },
2621
+ "name": {
2622
+ "type": "string",
2623
+ },
2624
+ "salt": {
2625
+ "type": "string",
2626
+ },
2627
+ "updated": {
2628
+ "format": "date-time",
2629
+ "type": "string",
2630
+ },
2631
+ "username": {
2632
+ "type": "string",
2633
+ },
2634
+ },
2635
+ "type": "object",
2636
+ },
2637
+ "source": {
2638
+ "properties": {
2639
+ "dateAdded": {
2640
+ "type": "string",
2641
+ },
2642
+ "href": {
2643
+ "type": "string",
2644
+ },
2645
+ "name": {
2646
+ "type": "string",
2647
+ },
2648
+ },
2649
+ "type": "object",
2650
+ },
2651
+ "tags": {
2652
+ "items": {
2653
+ "type": "string",
2654
+ },
2655
+ "type": "array",
2656
+ },
2657
+ },
2658
+ "required": [
2659
+ "likesIds",
2660
+ "_id",
2661
+ "created",
2662
+ "updated",
2663
+ ],
2664
+ "type": "object",
2665
+ },
2666
+ },
2667
+ },
2668
+ "description": "Successful create",
2669
+ },
2670
+ "400": {
2671
+ "content": {
2672
+ "application/json": {
2673
+ "schema": {
2674
+ "$ref": "#/components/schemas/APIError",
2675
+ },
2676
+ },
2677
+ },
2678
+ "description": "Bad request",
2679
+ },
2680
+ "401": {
2681
+ "description": "The user must be authenticated",
2682
+ },
2683
+ "403": {
2684
+ "content": {
2685
+ "application/json": {
2686
+ "schema": {
2687
+ "$ref": "#/components/schemas/APIError",
2688
+ },
2689
+ },
2690
+ },
2691
+ "description": "The user is not allowed to perform this action on this document",
2692
+ },
2693
+ "404": {
2694
+ "content": {
2695
+ "application/json": {
2696
+ "schema": {
2697
+ "$ref": "#/components/schemas/APIError",
2698
+ },
2699
+ },
2700
+ },
2701
+ "description": "Document not found",
2702
+ },
2703
+ "405": {
2704
+ "content": {
2705
+ "application/json": {
2706
+ "schema": {
2707
+ "$ref": "#/components/schemas/APIError",
2708
+ },
2709
+ },
2710
+ },
2711
+ "description": "The user is not allowed to perform this action on any document",
2712
+ },
2713
+ },
2714
+ "tags": [
2715
+ "foods",
2716
+ ],
2717
+ },
2718
+ },
2719
+ "/food/{id}": {
2720
+ "delete": {
2721
+ "parameters": [
2722
+ {
2723
+ "in": "path",
2724
+ "name": "id",
2725
+ "required": true,
2726
+ "schema": {
2727
+ "type": "string",
2728
+ },
2729
+ },
2730
+ ],
2731
+ "responses": {
2732
+ "204": {
2733
+ "description": "Successful delete",
2734
+ },
2735
+ "400": {
2736
+ "content": {
2737
+ "application/json": {
2738
+ "schema": {
2739
+ "$ref": "#/components/schemas/APIError",
2740
+ },
2741
+ },
2742
+ },
2743
+ "description": "Bad request",
2744
+ },
2745
+ "401": {
2746
+ "description": "The user must be authenticated",
2747
+ },
2748
+ "403": {
2749
+ "content": {
2750
+ "application/json": {
2751
+ "schema": {
2752
+ "$ref": "#/components/schemas/APIError",
2753
+ },
2754
+ },
2755
+ },
2756
+ "description": "The user is not allowed to perform this action on this document",
2757
+ },
2758
+ "404": {
2759
+ "content": {
2760
+ "application/json": {
2761
+ "schema": {
2762
+ "$ref": "#/components/schemas/APIError",
2763
+ },
2764
+ },
2765
+ },
2766
+ "description": "Document not found",
2767
+ },
2768
+ "405": {
2769
+ "content": {
2770
+ "application/json": {
2771
+ "schema": {
2772
+ "$ref": "#/components/schemas/APIError",
2773
+ },
2774
+ },
2775
+ },
2776
+ "description": "The user is not allowed to perform this action on any document",
2777
+ },
2778
+ },
2779
+ "tags": [
2780
+ "foods",
2781
+ ],
2782
+ },
2783
+ "get": {
2784
+ "parameters": [
2785
+ {
2786
+ "in": "path",
2787
+ "name": "id",
2788
+ "required": true,
2789
+ "schema": {
2790
+ "type": "string",
2791
+ },
2792
+ },
2793
+ ],
2794
+ "responses": {
2795
+ "200": {
2796
+ "content": {
2797
+ "application/json": {
2798
+ "schema": {
2799
+ "properties": {
2800
+ "_id": {
2801
+ "type": "string",
2802
+ },
2803
+ "calories": {
2804
+ "type": "number",
2805
+ },
2806
+ "categories": {
2807
+ "items": {
2808
+ "properties": {
2809
+ "_id": {
2810
+ "type": "string",
2811
+ },
2812
+ "created": {
2813
+ "format": "date-time",
2814
+ "type": "string",
2815
+ },
2816
+ "name": {
2817
+ "type": "string",
2818
+ },
2819
+ "show": {
2820
+ "type": "boolean",
2821
+ },
2822
+ "updated": {
2823
+ "format": "date-time",
2824
+ "type": "string",
2825
+ },
2826
+ },
2827
+ "required": [],
2828
+ "type": "object",
2829
+ },
2830
+ "type": "array",
2831
+ },
2832
+ "created": {
2833
+ "format": "date-time",
2834
+ "type": "string",
2835
+ },
2836
+ "description": {
2837
+ "type": "any",
2838
+ },
2839
+ "eatenBy": {
2840
+ "items": {
2841
+ "properties": {
2842
+ "__t": {
2843
+ "type": "string",
2844
+ },
2845
+ "_id": {
2846
+ "type": "string",
2847
+ },
2848
+ "admin": {
2849
+ "default": false,
2850
+ "type": "boolean",
2851
+ },
2852
+ "age": {
2853
+ "type": "number",
2854
+ },
2855
+ "attempts": {
2856
+ "default": 0,
2857
+ "type": "number",
2858
+ },
2859
+ "created": {
2860
+ "format": "date-time",
2861
+ "type": "string",
2862
+ },
2863
+ "disabled": {
2864
+ "default": false,
2865
+ "description": "When a user is set to disable, all requests will return a 401",
2866
+ "type": "boolean",
2867
+ },
2868
+ "email": {
2869
+ "type": "string",
2870
+ },
2871
+ "hash": {
2872
+ "type": "string",
2873
+ },
2874
+ "last": {
2875
+ "format": "date-time",
2876
+ "type": "string",
2877
+ },
2878
+ "name": {
2879
+ "type": "string",
2880
+ },
2881
+ "salt": {
2882
+ "type": "string",
2883
+ },
2884
+ "updated": {
2885
+ "format": "date-time",
2886
+ "type": "string",
2887
+ },
2888
+ "username": {
2889
+ "type": "string",
2890
+ },
2891
+ },
2892
+ "type": "object",
2893
+ },
2894
+ "type": "array",
2895
+ },
2896
+ "expiration": {
2897
+ "type": "dateonly",
2898
+ },
2899
+ "foo": {
2900
+ "type": "string",
2901
+ },
2902
+ "hidden": {
2903
+ "type": "boolean",
2904
+ },
2905
+ "lastEatenWith": {
2906
+ "additionalProperties": {
2907
+ "format": "date-time",
2908
+ "type": "string",
2909
+ },
2910
+ "type": "object",
2911
+ },
2912
+ "likesIds": {
2913
+ "items": {
2914
+ "properties": {
2915
+ "_id": {
2916
+ "type": "string",
2917
+ },
2918
+ "likes": {
2919
+ "type": "boolean",
2920
+ },
2921
+ "userId": {
2922
+ "type": "string",
2923
+ },
2924
+ },
2925
+ "required": [],
2926
+ "type": "object",
2927
+ },
2928
+ "type": "array",
2929
+ },
2930
+ "name": {
2931
+ "type": "string",
2932
+ },
2933
+ "ownerId": {
2934
+ "properties": {
2935
+ "__t": {
2936
+ "type": "string",
2937
+ },
2938
+ "_id": {
2939
+ "type": "string",
2940
+ },
2941
+ "admin": {
2942
+ "default": false,
2943
+ "type": "boolean",
2944
+ },
2945
+ "age": {
2946
+ "type": "number",
2947
+ },
2948
+ "attempts": {
2949
+ "default": 0,
2950
+ "type": "number",
2951
+ },
2952
+ "created": {
2953
+ "format": "date-time",
2954
+ "type": "string",
2955
+ },
2956
+ "disabled": {
2957
+ "default": false,
2958
+ "description": "When a user is set to disable, all requests will return a 401",
2959
+ "type": "boolean",
2960
+ },
2961
+ "email": {
2962
+ "type": "string",
2963
+ },
2964
+ "hash": {
2965
+ "type": "string",
2966
+ },
2967
+ "last": {
2968
+ "format": "date-time",
2969
+ "type": "string",
2970
+ },
2971
+ "name": {
2972
+ "type": "string",
2973
+ },
2974
+ "salt": {
2975
+ "type": "string",
2976
+ },
2977
+ "updated": {
2978
+ "format": "date-time",
2979
+ "type": "string",
2980
+ },
2981
+ "username": {
2982
+ "type": "string",
2983
+ },
2984
+ },
2985
+ "type": "object",
2986
+ },
2987
+ "source": {
2988
+ "properties": {
2989
+ "dateAdded": {
2990
+ "type": "string",
2991
+ },
2992
+ "href": {
2993
+ "type": "string",
2994
+ },
2995
+ "name": {
2996
+ "type": "string",
2997
+ },
2998
+ },
2999
+ "type": "object",
3000
+ },
3001
+ "tags": {
3002
+ "items": {
3003
+ "type": "string",
3004
+ },
3005
+ "type": "array",
3006
+ },
3007
+ },
3008
+ "required": [
3009
+ "likesIds",
3010
+ "_id",
3011
+ "created",
3012
+ "updated",
3013
+ ],
3014
+ "type": "object",
3015
+ },
3016
+ },
3017
+ },
3018
+ "description": "Successful read",
3019
+ },
3020
+ "400": {
3021
+ "content": {
3022
+ "application/json": {
3023
+ "schema": {
3024
+ "$ref": "#/components/schemas/APIError",
3025
+ },
3026
+ },
3027
+ },
3028
+ "description": "Bad request",
3029
+ },
3030
+ "401": {
3031
+ "description": "The user must be authenticated",
3032
+ },
3033
+ "403": {
3034
+ "content": {
3035
+ "application/json": {
3036
+ "schema": {
3037
+ "$ref": "#/components/schemas/APIError",
3038
+ },
3039
+ },
3040
+ },
3041
+ "description": "The user is not allowed to perform this action on this document",
3042
+ },
3043
+ "404": {
3044
+ "content": {
3045
+ "application/json": {
3046
+ "schema": {
3047
+ "$ref": "#/components/schemas/APIError",
3048
+ },
3049
+ },
3050
+ },
3051
+ "description": "Document not found",
3052
+ },
3053
+ "405": {
3054
+ "content": {
3055
+ "application/json": {
3056
+ "schema": {
3057
+ "$ref": "#/components/schemas/APIError",
3058
+ },
3059
+ },
3060
+ },
3061
+ "description": "The user is not allowed to perform this action on any document",
3062
+ },
3063
+ },
3064
+ "tags": [
3065
+ "foods",
3066
+ ],
3067
+ },
3068
+ "patch": {
3069
+ "parameters": [
3070
+ {
3071
+ "in": "path",
3072
+ "name": "id",
3073
+ "required": true,
3074
+ "schema": {
3075
+ "type": "string",
3076
+ },
3077
+ },
3078
+ ],
3079
+ "requestBody": {
3080
+ "content": {
3081
+ "application/json": {
3082
+ "schema": {
3083
+ "properties": {
3084
+ "_id": {
3085
+ "type": "string",
3086
+ },
3087
+ "calories": {
3088
+ "type": "number",
3089
+ },
3090
+ "categories": {
3091
+ "items": {
3092
+ "properties": {
3093
+ "_id": {
3094
+ "type": "string",
3095
+ },
3096
+ "created": {
3097
+ "format": "date-time",
3098
+ "type": "string",
3099
+ },
3100
+ "name": {
3101
+ "type": "string",
3102
+ },
3103
+ "show": {
3104
+ "type": "boolean",
3105
+ },
3106
+ "updated": {
3107
+ "format": "date-time",
3108
+ "type": "string",
3109
+ },
3110
+ },
3111
+ "required": [],
3112
+ "type": "object",
3113
+ },
3114
+ "type": "array",
3115
+ },
3116
+ "created": {
3117
+ "format": "date-time",
3118
+ "type": "string",
3119
+ },
3120
+ "description": {
3121
+ "type": "any",
3122
+ },
3123
+ "eatenBy": {
3124
+ "items": {
3125
+ "properties": {
3126
+ "__t": {
3127
+ "type": "string",
3128
+ },
3129
+ "_id": {
3130
+ "type": "string",
3131
+ },
3132
+ "admin": {
3133
+ "default": false,
3134
+ "type": "boolean",
3135
+ },
3136
+ "age": {
3137
+ "type": "number",
3138
+ },
3139
+ "attempts": {
3140
+ "default": 0,
3141
+ "type": "number",
3142
+ },
3143
+ "created": {
3144
+ "format": "date-time",
3145
+ "type": "string",
3146
+ },
3147
+ "disabled": {
3148
+ "default": false,
3149
+ "description": "When a user is set to disable, all requests will return a 401",
3150
+ "type": "boolean",
3151
+ },
3152
+ "email": {
3153
+ "type": "string",
3154
+ },
3155
+ "hash": {
3156
+ "type": "string",
3157
+ },
3158
+ "last": {
3159
+ "format": "date-time",
3160
+ "type": "string",
3161
+ },
3162
+ "name": {
3163
+ "type": "string",
3164
+ },
3165
+ "salt": {
3166
+ "type": "string",
3167
+ },
3168
+ "updated": {
3169
+ "format": "date-time",
3170
+ "type": "string",
3171
+ },
3172
+ "username": {
3173
+ "type": "string",
3174
+ },
3175
+ },
3176
+ "type": "object",
3177
+ },
3178
+ "type": "array",
3179
+ },
3180
+ "expiration": {
3181
+ "type": "dateonly",
3182
+ },
3183
+ "foo": {
3184
+ "type": "string",
3185
+ },
3186
+ "hidden": {
3187
+ "type": "boolean",
3188
+ },
3189
+ "lastEatenWith": {
3190
+ "additionalProperties": {
3191
+ "format": "date-time",
3192
+ "type": "string",
3193
+ },
3194
+ "type": "object",
3195
+ },
3196
+ "likesIds": {
3197
+ "items": {
3198
+ "properties": {
3199
+ "_id": {
3200
+ "type": "string",
3201
+ },
3202
+ "likes": {
3203
+ "type": "boolean",
3204
+ },
3205
+ "userId": {
3206
+ "type": "string",
3207
+ },
3208
+ },
3209
+ "required": [],
3210
+ "type": "object",
3211
+ },
3212
+ "type": "array",
3213
+ },
3214
+ "name": {
3215
+ "type": "string",
3216
+ },
3217
+ "ownerId": {
3218
+ "properties": {
3219
+ "__t": {
3220
+ "type": "string",
3221
+ },
3222
+ "_id": {
3223
+ "type": "string",
3224
+ },
3225
+ "admin": {
3226
+ "default": false,
3227
+ "type": "boolean",
3228
+ },
3229
+ "age": {
3230
+ "type": "number",
3231
+ },
3232
+ "attempts": {
3233
+ "default": 0,
3234
+ "type": "number",
3235
+ },
3236
+ "created": {
3237
+ "format": "date-time",
3238
+ "type": "string",
3239
+ },
3240
+ "disabled": {
3241
+ "default": false,
3242
+ "description": "When a user is set to disable, all requests will return a 401",
3243
+ "type": "boolean",
3244
+ },
3245
+ "email": {
3246
+ "type": "string",
3247
+ },
3248
+ "hash": {
3249
+ "type": "string",
3250
+ },
3251
+ "last": {
3252
+ "format": "date-time",
3253
+ "type": "string",
3254
+ },
3255
+ "name": {
3256
+ "type": "string",
3257
+ },
3258
+ "salt": {
3259
+ "type": "string",
3260
+ },
3261
+ "updated": {
3262
+ "format": "date-time",
3263
+ "type": "string",
3264
+ },
3265
+ "username": {
3266
+ "type": "string",
3267
+ },
3268
+ },
3269
+ "type": "object",
3270
+ },
3271
+ "source": {
3272
+ "properties": {
3273
+ "dateAdded": {
3274
+ "type": "string",
3275
+ },
3276
+ "href": {
3277
+ "type": "string",
3278
+ },
3279
+ "name": {
3280
+ "type": "string",
3281
+ },
3282
+ },
3283
+ "type": "object",
3284
+ },
3285
+ "tags": {
3286
+ "items": {
3287
+ "type": "string",
3288
+ },
3289
+ "type": "array",
3290
+ },
3291
+ },
3292
+ "type": "object",
3293
+ },
3294
+ },
3295
+ },
3296
+ "required": true,
3297
+ },
3298
+ "responses": {
3299
+ "200": {
3300
+ "content": {
3301
+ "application/json": {
3302
+ "schema": {
3303
+ "properties": {
3304
+ "_id": {
3305
+ "type": "string",
3306
+ },
3307
+ "calories": {
3308
+ "type": "number",
3309
+ },
3310
+ "categories": {
3311
+ "items": {
3312
+ "properties": {
3313
+ "_id": {
3314
+ "type": "string",
3315
+ },
3316
+ "created": {
3317
+ "format": "date-time",
3318
+ "type": "string",
3319
+ },
3320
+ "name": {
3321
+ "type": "string",
3322
+ },
3323
+ "show": {
3324
+ "type": "boolean",
3325
+ },
3326
+ "updated": {
3327
+ "format": "date-time",
3328
+ "type": "string",
3329
+ },
3330
+ },
3331
+ "required": [],
3332
+ "type": "object",
3333
+ },
3334
+ "type": "array",
3335
+ },
3336
+ "created": {
3337
+ "format": "date-time",
3338
+ "type": "string",
3339
+ },
3340
+ "description": {
3341
+ "type": "any",
3342
+ },
3343
+ "eatenBy": {
3344
+ "items": {
3345
+ "properties": {
3346
+ "__t": {
3347
+ "type": "string",
3348
+ },
3349
+ "_id": {
3350
+ "type": "string",
3351
+ },
3352
+ "admin": {
3353
+ "default": false,
3354
+ "type": "boolean",
3355
+ },
3356
+ "age": {
3357
+ "type": "number",
3358
+ },
3359
+ "attempts": {
3360
+ "default": 0,
3361
+ "type": "number",
3362
+ },
3363
+ "created": {
3364
+ "format": "date-time",
3365
+ "type": "string",
3366
+ },
3367
+ "disabled": {
3368
+ "default": false,
3369
+ "description": "When a user is set to disable, all requests will return a 401",
3370
+ "type": "boolean",
3371
+ },
3372
+ "email": {
3373
+ "type": "string",
3374
+ },
3375
+ "hash": {
3376
+ "type": "string",
3377
+ },
3378
+ "last": {
3379
+ "format": "date-time",
3380
+ "type": "string",
3381
+ },
3382
+ "name": {
3383
+ "type": "string",
3384
+ },
3385
+ "salt": {
3386
+ "type": "string",
3387
+ },
3388
+ "updated": {
3389
+ "format": "date-time",
3390
+ "type": "string",
3391
+ },
3392
+ "username": {
3393
+ "type": "string",
3394
+ },
3395
+ },
3396
+ "type": "object",
3397
+ },
3398
+ "type": "array",
3399
+ },
3400
+ "expiration": {
3401
+ "type": "dateonly",
3402
+ },
3403
+ "foo": {
3404
+ "type": "string",
3405
+ },
3406
+ "hidden": {
3407
+ "type": "boolean",
3408
+ },
3409
+ "lastEatenWith": {
3410
+ "additionalProperties": {
3411
+ "format": "date-time",
3412
+ "type": "string",
3413
+ },
3414
+ "type": "object",
3415
+ },
3416
+ "likesIds": {
3417
+ "items": {
3418
+ "properties": {
3419
+ "_id": {
3420
+ "type": "string",
3421
+ },
3422
+ "likes": {
3423
+ "type": "boolean",
3424
+ },
3425
+ "userId": {
3426
+ "type": "string",
3427
+ },
3428
+ },
3429
+ "required": [],
3430
+ "type": "object",
3431
+ },
3432
+ "type": "array",
3433
+ },
3434
+ "name": {
3435
+ "type": "string",
3436
+ },
3437
+ "ownerId": {
3438
+ "properties": {
3439
+ "__t": {
3440
+ "type": "string",
3441
+ },
3442
+ "_id": {
3443
+ "type": "string",
3444
+ },
3445
+ "admin": {
3446
+ "default": false,
3447
+ "type": "boolean",
3448
+ },
3449
+ "age": {
3450
+ "type": "number",
3451
+ },
3452
+ "attempts": {
3453
+ "default": 0,
3454
+ "type": "number",
3455
+ },
3456
+ "created": {
3457
+ "format": "date-time",
3458
+ "type": "string",
3459
+ },
3460
+ "disabled": {
3461
+ "default": false,
3462
+ "description": "When a user is set to disable, all requests will return a 401",
3463
+ "type": "boolean",
3464
+ },
3465
+ "email": {
3466
+ "type": "string",
3467
+ },
3468
+ "hash": {
3469
+ "type": "string",
3470
+ },
3471
+ "last": {
3472
+ "format": "date-time",
3473
+ "type": "string",
3474
+ },
3475
+ "name": {
3476
+ "type": "string",
3477
+ },
3478
+ "salt": {
3479
+ "type": "string",
3480
+ },
3481
+ "updated": {
3482
+ "format": "date-time",
3483
+ "type": "string",
3484
+ },
3485
+ "username": {
3486
+ "type": "string",
3487
+ },
3488
+ },
3489
+ "type": "object",
3490
+ },
3491
+ "source": {
3492
+ "properties": {
3493
+ "dateAdded": {
3494
+ "type": "string",
3495
+ },
3496
+ "href": {
3497
+ "type": "string",
3498
+ },
3499
+ "name": {
3500
+ "type": "string",
3501
+ },
3502
+ },
3503
+ "type": "object",
3504
+ },
3505
+ "tags": {
3506
+ "items": {
3507
+ "type": "string",
3508
+ },
3509
+ "type": "array",
3510
+ },
3511
+ },
3512
+ "required": [
3513
+ "likesIds",
3514
+ "_id",
3515
+ "created",
3516
+ "updated",
3517
+ ],
3518
+ "type": "object",
3519
+ },
3520
+ },
3521
+ },
3522
+ "description": "Successful update",
3523
+ },
3524
+ "400": {
3525
+ "content": {
3526
+ "application/json": {
3527
+ "schema": {
3528
+ "$ref": "#/components/schemas/APIError",
3529
+ },
3530
+ },
3531
+ },
3532
+ "description": "Bad request",
3533
+ },
3534
+ "401": {
3535
+ "description": "The user must be authenticated",
3536
+ },
3537
+ "403": {
3538
+ "content": {
3539
+ "application/json": {
3540
+ "schema": {
3541
+ "$ref": "#/components/schemas/APIError",
3542
+ },
3543
+ },
3544
+ },
3545
+ "description": "The user is not allowed to perform this action on this document",
3546
+ },
3547
+ "404": {
3548
+ "content": {
3549
+ "application/json": {
3550
+ "schema": {
3551
+ "$ref": "#/components/schemas/APIError",
3552
+ },
3553
+ },
3554
+ },
3555
+ "description": "Document not found",
3556
+ },
3557
+ "405": {
3558
+ "content": {
3559
+ "application/json": {
3560
+ "schema": {
3561
+ "$ref": "#/components/schemas/APIError",
3562
+ },
3563
+ },
3564
+ },
3565
+ "description": "The user is not allowed to perform this action on any document",
3566
+ },
3567
+ },
3568
+ "tags": [
3569
+ "foods",
3570
+ ],
3571
+ },
3572
+ },
3573
+ },
3574
+ }
3575
+ `;
3576
+
3577
+ exports[`openApi gets the openapi.json and has correct Number query fields 1`] = `
3578
+ {
3579
+ "in": "query",
3580
+ "name": "calories",
3581
+ "schema": {
3582
+ "oneOf": [
3583
+ {
3584
+ "type": "number",
3585
+ },
3586
+ {
3587
+ "properties": {
3588
+ "$gt": {
3589
+ "type": "number",
3590
+ },
3591
+ "$gte": {
3592
+ "type": "number",
3593
+ },
3594
+ "$lt": {
3595
+ "type": "number",
3596
+ },
3597
+ "$lte": {
3598
+ "type": "number",
3599
+ },
3600
+ },
3601
+ "type": "object",
3602
+ },
3603
+ ],
3604
+ },
3605
+ }
3606
+ `;
3607
+
3608
+ exports[`openApi populate gets the openapi.json with populate 1`] = `
3609
+ {
3610
+ "components": {
3611
+ "schemas": {
3612
+ "APIError": {
3613
+ "properties": {
3614
+ "code": {
3615
+ "description": "An application-specific error code, expressed as a string value.",
3616
+ "type": "string",
3617
+ },
3618
+ "detail": {
3619
+ "description": "A human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.",
3620
+ "type": "string",
3621
+ },
3622
+ "id": {
3623
+ "description": "A unique identifier for this particular occurrence of the problem.",
3624
+ "type": "string",
3625
+ },
3626
+ "links": {
3627
+ "properties": {
3628
+ "about": {
3629
+ "description": "A link that leads to further details about this particular occurrence of the problem. When derefenced, this URI SHOULD return a human-readable description of the error.",
3630
+ "type": "string",
3631
+ },
3632
+ "type": {
3633
+ "description": "A link that identifies the type of error that this particular error is an instance of. This URI SHOULD be dereferencable to a human-readable explanation of the general error.",
3634
+ "type": "string",
3635
+ },
3636
+ },
3637
+ "type": "object",
3638
+ },
3639
+ "meta": {
3640
+ "description": "A meta object containing non-standard meta-information about the error.",
3641
+ "type": "object",
3642
+ },
3643
+ "source": {
3644
+ "properties": {
3645
+ "header": {
3646
+ "description": "A string indicating the name of a single request header which caused the error.",
3647
+ "type": "string",
3648
+ },
3649
+ "parameter": {
3650
+ "description": "A string indicating which URI query parameter caused the error.",
3651
+ "type": "string",
3652
+ },
3653
+ "pointer": {
3654
+ "description": "A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].",
3655
+ "type": "string",
3656
+ },
3657
+ },
3658
+ "type": "object",
3659
+ },
3660
+ "status": {
3661
+ "description": "The HTTP status code applicable to this problem, expressed as a string value.",
3662
+ "type": "number",
3663
+ },
3664
+ "title": {
3665
+ "description": "The error message",
3666
+ "type": "string",
3667
+ },
3668
+ },
3669
+ "type": "object",
3670
+ },
3671
+ "LimitedUser": {
3672
+ "properties": {
3673
+ "email": {
3674
+ "description": "LimitedUser's email",
3675
+ "type": "string",
3676
+ },
3677
+ "name": {
3678
+ "description": "LimitedUser's name",
3679
+ "type": "string",
3680
+ },
3681
+ },
3682
+ "type": "object",
3683
+ },
3684
+ },
3685
+ },
3686
+ "info": {
3687
+ "description": "Generated docs from an Express api",
3688
+ "title": "Express Application",
3689
+ "version": "1.0.0",
3690
+ },
3691
+ "openapi": "3.0.0",
3692
+ "paths": {
3693
+ "/food/": {
3694
+ "get": {
3695
+ "parameters": [
3696
+ {
3697
+ "in": "query",
3698
+ "name": "_id",
3699
+ "schema": {
3700
+ "properties": {
3701
+ "$in": {
3702
+ "items": {
3703
+ "type": "string",
3704
+ },
3705
+ "type": "array",
3706
+ },
3707
+ },
3708
+ "type": "object",
3709
+ },
3710
+ },
3711
+ {
3712
+ "in": "query",
3713
+ "name": "page",
3714
+ "schema": {
3715
+ "type": "number",
3716
+ },
3717
+ },
3718
+ {
3719
+ "in": "query",
3720
+ "name": "sort",
3721
+ "schema": {
3722
+ "type": "string",
3723
+ },
3724
+ },
3725
+ {
3726
+ "in": "query",
3727
+ "name": "limit",
3728
+ "schema": {
3729
+ "type": "number",
3730
+ },
3731
+ },
3732
+ ],
3733
+ "responses": {
3734
+ "200": {
3735
+ "content": {
3736
+ "application/json": {
3737
+ "schema": {
3738
+ "properties": {
3739
+ "data": {
3740
+ "items": {
3741
+ "properties": {
3742
+ "_id": {
3743
+ "type": "string",
3744
+ },
3745
+ "calories": {
3746
+ "type": "number",
3747
+ },
3748
+ "categories": {
3749
+ "items": {
3750
+ "properties": {
3751
+ "_id": {
3752
+ "type": "string",
3753
+ },
3754
+ "created": {
3755
+ "format": "date-time",
3756
+ "type": "string",
3757
+ },
3758
+ "name": {
3759
+ "type": "string",
3760
+ },
3761
+ "show": {
3762
+ "type": "boolean",
3763
+ },
3764
+ "updated": {
3765
+ "format": "date-time",
3766
+ "type": "string",
3767
+ },
3768
+ },
3769
+ "required": [],
3770
+ "type": "object",
3771
+ },
3772
+ "type": "array",
3773
+ },
3774
+ "created": {
3775
+ "format": "date-time",
3776
+ "type": "string",
3777
+ },
3778
+ "description": {
3779
+ "type": "any",
3780
+ },
3781
+ "eatenBy": {
3782
+ "items": {
3783
+ "$ref": "#/components/schemas/LimitedUser",
3784
+ },
3785
+ "type": "array",
3786
+ },
3787
+ "expiration": {
3788
+ "type": "dateonly",
3789
+ },
3790
+ "foo": {
3791
+ "type": "string",
3792
+ },
3793
+ "hidden": {
3794
+ "type": "boolean",
3795
+ },
3796
+ "lastEatenWith": {
3797
+ "additionalProperties": {
3798
+ "format": "date-time",
3799
+ "type": "string",
3800
+ },
3801
+ "type": "object",
3802
+ },
3803
+ "likesIds": {
3804
+ "items": {
3805
+ "properties": {
3806
+ "_id": {
3807
+ "type": "string",
3808
+ },
3809
+ "likes": {
3810
+ "type": "boolean",
3811
+ },
3812
+ "userId": {
3813
+ "$ref": "#/components/schemas/LimitedUser",
3814
+ },
3815
+ },
3816
+ "required": [],
3817
+ "type": "object",
3818
+ },
3819
+ "type": "array",
3820
+ },
3821
+ "name": {
3822
+ "type": "string",
3823
+ },
3824
+ "ownerId": {
3825
+ "properties": {
3826
+ "email": {
3827
+ "type": "string",
3828
+ },
3829
+ "name": {
3830
+ "type": "string",
3831
+ },
3832
+ },
3833
+ "type": "object",
3834
+ },
3835
+ "source": {
3836
+ "properties": {
3837
+ "dateAdded": {
3838
+ "type": "string",
3839
+ },
3840
+ "href": {
3841
+ "type": "string",
3842
+ },
3843
+ "name": {
3844
+ "type": "string",
3845
+ },
3846
+ },
3847
+ "type": "object",
3848
+ },
3849
+ "tags": {
3850
+ "items": {
3851
+ "type": "string",
3852
+ },
3853
+ "type": "array",
3854
+ },
3855
+ },
3856
+ "required": [
3857
+ "likesIds",
3858
+ "_id",
3859
+ "created",
3860
+ "updated",
3861
+ ],
3862
+ "type": "object",
3863
+ },
3864
+ "type": "array",
3865
+ },
3866
+ "limit": {
3867
+ "type": "number",
3868
+ },
3869
+ "more": {
3870
+ "type": "boolean",
3871
+ },
3872
+ "page": {
3873
+ "type": "number",
3874
+ },
3875
+ "total": {
3876
+ "type": "number",
3877
+ },
3878
+ },
3879
+ "type": "object",
3880
+ },
3881
+ },
3882
+ },
3883
+ "description": "Successful list",
3884
+ },
3885
+ "400": {
3886
+ "content": {
3887
+ "application/json": {
3888
+ "schema": {
3889
+ "$ref": "#/components/schemas/APIError",
3890
+ },
3891
+ },
3892
+ },
3893
+ "description": "Bad request",
3894
+ },
3895
+ "401": {
3896
+ "description": "The user must be authenticated",
3897
+ },
3898
+ "403": {
3899
+ "content": {
3900
+ "application/json": {
3901
+ "schema": {
3902
+ "$ref": "#/components/schemas/APIError",
3903
+ },
3904
+ },
3905
+ },
3906
+ "description": "The user is not allowed to perform this action on this document",
3907
+ },
3908
+ "404": {
3909
+ "content": {
3910
+ "application/json": {
3911
+ "schema": {
3912
+ "$ref": "#/components/schemas/APIError",
3913
+ },
3914
+ },
3915
+ },
3916
+ "description": "Document not found",
3917
+ },
3918
+ "405": {
3919
+ "content": {
3920
+ "application/json": {
3921
+ "schema": {
3922
+ "$ref": "#/components/schemas/APIError",
3923
+ },
3924
+ },
3925
+ },
3926
+ "description": "The user is not allowed to perform this action on any document",
3927
+ },
3928
+ },
3929
+ "tags": [
3930
+ "foods",
3931
+ ],
3932
+ },
3933
+ "post": {
3934
+ "requestBody": {
3935
+ "content": {
3936
+ "application/json": {
3937
+ "schema": {
3938
+ "properties": {
3939
+ "_id": {
3940
+ "type": "string",
3941
+ },
3942
+ "calories": {
3943
+ "type": "number",
3944
+ },
3945
+ "categories": {
3946
+ "items": {
3947
+ "properties": {
3948
+ "_id": {
3949
+ "type": "string",
3950
+ },
3951
+ "created": {
3952
+ "format": "date-time",
3953
+ "type": "string",
3954
+ },
3955
+ "name": {
3956
+ "type": "string",
3957
+ },
3958
+ "show": {
3959
+ "type": "boolean",
3960
+ },
3961
+ "updated": {
3962
+ "format": "date-time",
3963
+ "type": "string",
3964
+ },
3965
+ },
3966
+ "required": [],
3967
+ "type": "object",
3968
+ },
3969
+ "type": "array",
3970
+ },
3971
+ "created": {
3972
+ "format": "date-time",
3973
+ "type": "string",
3974
+ },
3975
+ "description": {
3976
+ "type": "any",
3977
+ },
3978
+ "eatenBy": {
3979
+ "items": {
3980
+ "$ref": "#/components/schemas/LimitedUser",
3981
+ },
3982
+ "type": "array",
3983
+ },
3984
+ "expiration": {
3985
+ "type": "dateonly",
3986
+ },
3987
+ "foo": {
3988
+ "type": "string",
3989
+ },
3990
+ "hidden": {
3991
+ "type": "boolean",
3992
+ },
3993
+ "lastEatenWith": {
3994
+ "additionalProperties": {
3995
+ "format": "date-time",
3996
+ "type": "string",
3997
+ },
3998
+ "type": "object",
3999
+ },
4000
+ "likesIds": {
4001
+ "items": {
4002
+ "properties": {
4003
+ "_id": {
4004
+ "type": "string",
4005
+ },
4006
+ "likes": {
4007
+ "type": "boolean",
4008
+ },
4009
+ "userId": {
4010
+ "$ref": "#/components/schemas/LimitedUser",
4011
+ },
4012
+ },
4013
+ "required": [],
4014
+ "type": "object",
4015
+ },
4016
+ "type": "array",
4017
+ },
4018
+ "name": {
4019
+ "type": "string",
4020
+ },
4021
+ "ownerId": {
4022
+ "properties": {
4023
+ "email": {
4024
+ "type": "string",
4025
+ },
4026
+ "name": {
4027
+ "type": "string",
4028
+ },
4029
+ },
4030
+ "type": "object",
4031
+ },
4032
+ "source": {
4033
+ "properties": {
4034
+ "dateAdded": {
4035
+ "type": "string",
4036
+ },
4037
+ "href": {
4038
+ "type": "string",
4039
+ },
4040
+ "name": {
4041
+ "type": "string",
4042
+ },
4043
+ },
4044
+ "type": "object",
4045
+ },
4046
+ "tags": {
4047
+ "items": {
4048
+ "type": "string",
4049
+ },
4050
+ "type": "array",
4051
+ },
4052
+ },
4053
+ "type": "object",
4054
+ },
4055
+ },
4056
+ },
4057
+ "required": true,
4058
+ },
4059
+ "responses": {
4060
+ "201": {
4061
+ "content": {
4062
+ "application/json": {
4063
+ "schema": {
4064
+ "properties": {
4065
+ "_id": {
4066
+ "type": "string",
4067
+ },
4068
+ "calories": {
4069
+ "type": "number",
4070
+ },
4071
+ "categories": {
4072
+ "items": {
4073
+ "properties": {
4074
+ "_id": {
4075
+ "type": "string",
4076
+ },
4077
+ "created": {
4078
+ "format": "date-time",
4079
+ "type": "string",
4080
+ },
4081
+ "name": {
4082
+ "type": "string",
4083
+ },
4084
+ "show": {
4085
+ "type": "boolean",
4086
+ },
4087
+ "updated": {
4088
+ "format": "date-time",
4089
+ "type": "string",
4090
+ },
4091
+ },
4092
+ "required": [],
4093
+ "type": "object",
4094
+ },
4095
+ "type": "array",
4096
+ },
4097
+ "created": {
4098
+ "format": "date-time",
4099
+ "type": "string",
4100
+ },
4101
+ "description": {
4102
+ "type": "any",
4103
+ },
4104
+ "eatenBy": {
4105
+ "items": {
4106
+ "$ref": "#/components/schemas/LimitedUser",
4107
+ },
4108
+ "type": "array",
4109
+ },
4110
+ "expiration": {
4111
+ "type": "dateonly",
4112
+ },
4113
+ "foo": {
4114
+ "type": "string",
4115
+ },
4116
+ "hidden": {
4117
+ "type": "boolean",
4118
+ },
4119
+ "lastEatenWith": {
4120
+ "additionalProperties": {
4121
+ "format": "date-time",
4122
+ "type": "string",
4123
+ },
4124
+ "type": "object",
4125
+ },
4126
+ "likesIds": {
4127
+ "items": {
4128
+ "properties": {
4129
+ "_id": {
4130
+ "type": "string",
4131
+ },
4132
+ "likes": {
4133
+ "type": "boolean",
4134
+ },
4135
+ "userId": {
4136
+ "$ref": "#/components/schemas/LimitedUser",
4137
+ },
4138
+ },
4139
+ "required": [],
4140
+ "type": "object",
4141
+ },
4142
+ "type": "array",
4143
+ },
4144
+ "name": {
4145
+ "type": "string",
4146
+ },
4147
+ "ownerId": {
4148
+ "properties": {
4149
+ "email": {
4150
+ "type": "string",
4151
+ },
4152
+ "name": {
4153
+ "type": "string",
4154
+ },
4155
+ },
4156
+ "type": "object",
4157
+ },
4158
+ "source": {
4159
+ "properties": {
4160
+ "dateAdded": {
4161
+ "type": "string",
4162
+ },
4163
+ "href": {
4164
+ "type": "string",
4165
+ },
4166
+ "name": {
4167
+ "type": "string",
4168
+ },
4169
+ },
4170
+ "type": "object",
4171
+ },
4172
+ "tags": {
4173
+ "items": {
4174
+ "type": "string",
4175
+ },
4176
+ "type": "array",
4177
+ },
4178
+ },
4179
+ "required": [
4180
+ "likesIds",
4181
+ "_id",
4182
+ "created",
4183
+ "updated",
4184
+ ],
4185
+ "type": "object",
4186
+ },
4187
+ },
4188
+ },
4189
+ "description": "Successful create",
4190
+ },
4191
+ "400": {
4192
+ "content": {
4193
+ "application/json": {
4194
+ "schema": {
4195
+ "$ref": "#/components/schemas/APIError",
4196
+ },
4197
+ },
4198
+ },
4199
+ "description": "Bad request",
4200
+ },
4201
+ "401": {
4202
+ "description": "The user must be authenticated",
4203
+ },
4204
+ "403": {
4205
+ "content": {
4206
+ "application/json": {
4207
+ "schema": {
4208
+ "$ref": "#/components/schemas/APIError",
4209
+ },
4210
+ },
4211
+ },
4212
+ "description": "The user is not allowed to perform this action on this document",
4213
+ },
4214
+ "404": {
4215
+ "content": {
4216
+ "application/json": {
4217
+ "schema": {
4218
+ "$ref": "#/components/schemas/APIError",
4219
+ },
4220
+ },
4221
+ },
4222
+ "description": "Document not found",
4223
+ },
4224
+ "405": {
4225
+ "content": {
4226
+ "application/json": {
4227
+ "schema": {
4228
+ "$ref": "#/components/schemas/APIError",
4229
+ },
4230
+ },
4231
+ },
4232
+ "description": "The user is not allowed to perform this action on any document",
4233
+ },
4234
+ },
4235
+ "tags": [
4236
+ "foods",
4237
+ ],
4238
+ },
4239
+ },
4240
+ "/food/{id}": {
4241
+ "delete": {
4242
+ "parameters": [
4243
+ {
4244
+ "in": "path",
4245
+ "name": "id",
4246
+ "required": true,
4247
+ "schema": {
4248
+ "type": "string",
4249
+ },
4250
+ },
4251
+ ],
4252
+ "responses": {
4253
+ "204": {
4254
+ "description": "Successful delete",
4255
+ },
4256
+ "400": {
4257
+ "content": {
4258
+ "application/json": {
4259
+ "schema": {
4260
+ "$ref": "#/components/schemas/APIError",
4261
+ },
4262
+ },
4263
+ },
4264
+ "description": "Bad request",
4265
+ },
4266
+ "401": {
4267
+ "description": "The user must be authenticated",
4268
+ },
4269
+ "403": {
4270
+ "content": {
4271
+ "application/json": {
4272
+ "schema": {
4273
+ "$ref": "#/components/schemas/APIError",
4274
+ },
4275
+ },
4276
+ },
4277
+ "description": "The user is not allowed to perform this action on this document",
4278
+ },
4279
+ "404": {
4280
+ "content": {
4281
+ "application/json": {
4282
+ "schema": {
4283
+ "$ref": "#/components/schemas/APIError",
4284
+ },
4285
+ },
4286
+ },
4287
+ "description": "Document not found",
4288
+ },
4289
+ "405": {
4290
+ "content": {
4291
+ "application/json": {
4292
+ "schema": {
4293
+ "$ref": "#/components/schemas/APIError",
4294
+ },
4295
+ },
4296
+ },
4297
+ "description": "The user is not allowed to perform this action on any document",
4298
+ },
4299
+ },
4300
+ "tags": [
4301
+ "foods",
4302
+ ],
4303
+ },
4304
+ "get": {
4305
+ "parameters": [
4306
+ {
4307
+ "in": "path",
4308
+ "name": "id",
4309
+ "required": true,
4310
+ "schema": {
4311
+ "type": "string",
4312
+ },
4313
+ },
4314
+ ],
4315
+ "responses": {
4316
+ "200": {
4317
+ "content": {
4318
+ "application/json": {
4319
+ "schema": {
4320
+ "properties": {
4321
+ "_id": {
4322
+ "type": "string",
4323
+ },
4324
+ "calories": {
4325
+ "type": "number",
4326
+ },
4327
+ "categories": {
4328
+ "items": {
4329
+ "properties": {
4330
+ "_id": {
4331
+ "type": "string",
4332
+ },
4333
+ "created": {
4334
+ "format": "date-time",
4335
+ "type": "string",
4336
+ },
4337
+ "name": {
4338
+ "type": "string",
4339
+ },
4340
+ "show": {
4341
+ "type": "boolean",
4342
+ },
4343
+ "updated": {
4344
+ "format": "date-time",
4345
+ "type": "string",
4346
+ },
4347
+ },
4348
+ "required": [],
4349
+ "type": "object",
4350
+ },
4351
+ "type": "array",
4352
+ },
4353
+ "created": {
4354
+ "format": "date-time",
4355
+ "type": "string",
4356
+ },
4357
+ "description": {
4358
+ "type": "any",
4359
+ },
4360
+ "eatenBy": {
4361
+ "items": {
4362
+ "$ref": "#/components/schemas/LimitedUser",
4363
+ },
4364
+ "type": "array",
4365
+ },
4366
+ "expiration": {
4367
+ "type": "dateonly",
4368
+ },
4369
+ "foo": {
4370
+ "type": "string",
4371
+ },
4372
+ "hidden": {
4373
+ "type": "boolean",
4374
+ },
4375
+ "lastEatenWith": {
4376
+ "additionalProperties": {
4377
+ "format": "date-time",
4378
+ "type": "string",
4379
+ },
4380
+ "type": "object",
4381
+ },
4382
+ "likesIds": {
4383
+ "items": {
4384
+ "properties": {
4385
+ "_id": {
4386
+ "type": "string",
4387
+ },
4388
+ "likes": {
4389
+ "type": "boolean",
4390
+ },
4391
+ "userId": {
4392
+ "$ref": "#/components/schemas/LimitedUser",
4393
+ },
4394
+ },
4395
+ "required": [],
4396
+ "type": "object",
4397
+ },
4398
+ "type": "array",
4399
+ },
4400
+ "name": {
4401
+ "type": "string",
4402
+ },
4403
+ "ownerId": {
4404
+ "properties": {
4405
+ "email": {
4406
+ "type": "string",
4407
+ },
4408
+ "name": {
4409
+ "type": "string",
4410
+ },
4411
+ },
4412
+ "type": "object",
4413
+ },
4414
+ "source": {
4415
+ "properties": {
4416
+ "dateAdded": {
4417
+ "type": "string",
4418
+ },
4419
+ "href": {
4420
+ "type": "string",
4421
+ },
4422
+ "name": {
4423
+ "type": "string",
4424
+ },
4425
+ },
4426
+ "type": "object",
4427
+ },
4428
+ "tags": {
4429
+ "items": {
4430
+ "type": "string",
4431
+ },
4432
+ "type": "array",
4433
+ },
4434
+ },
4435
+ "required": [
4436
+ "likesIds",
4437
+ "_id",
4438
+ "created",
4439
+ "updated",
4440
+ ],
4441
+ "type": "object",
4442
+ },
4443
+ },
4444
+ },
4445
+ "description": "Successful read",
4446
+ },
4447
+ "400": {
4448
+ "content": {
4449
+ "application/json": {
4450
+ "schema": {
4451
+ "$ref": "#/components/schemas/APIError",
4452
+ },
4453
+ },
4454
+ },
4455
+ "description": "Bad request",
4456
+ },
4457
+ "401": {
4458
+ "description": "The user must be authenticated",
4459
+ },
4460
+ "403": {
4461
+ "content": {
4462
+ "application/json": {
4463
+ "schema": {
4464
+ "$ref": "#/components/schemas/APIError",
4465
+ },
4466
+ },
4467
+ },
4468
+ "description": "The user is not allowed to perform this action on this document",
4469
+ },
4470
+ "404": {
4471
+ "content": {
4472
+ "application/json": {
4473
+ "schema": {
4474
+ "$ref": "#/components/schemas/APIError",
4475
+ },
4476
+ },
4477
+ },
4478
+ "description": "Document not found",
4479
+ },
4480
+ "405": {
4481
+ "content": {
4482
+ "application/json": {
4483
+ "schema": {
4484
+ "$ref": "#/components/schemas/APIError",
4485
+ },
4486
+ },
4487
+ },
4488
+ "description": "The user is not allowed to perform this action on any document",
4489
+ },
4490
+ },
4491
+ "tags": [
4492
+ "foods",
4493
+ ],
4494
+ },
4495
+ "patch": {
4496
+ "parameters": [
4497
+ {
4498
+ "in": "path",
4499
+ "name": "id",
4500
+ "required": true,
4501
+ "schema": {
4502
+ "type": "string",
4503
+ },
4504
+ },
4505
+ ],
4506
+ "requestBody": {
4507
+ "content": {
4508
+ "application/json": {
4509
+ "schema": {
4510
+ "properties": {
4511
+ "_id": {
4512
+ "type": "string",
4513
+ },
4514
+ "calories": {
4515
+ "type": "number",
4516
+ },
4517
+ "categories": {
4518
+ "items": {
4519
+ "properties": {
4520
+ "_id": {
4521
+ "type": "string",
4522
+ },
4523
+ "created": {
4524
+ "format": "date-time",
4525
+ "type": "string",
4526
+ },
4527
+ "name": {
4528
+ "type": "string",
4529
+ },
4530
+ "show": {
4531
+ "type": "boolean",
4532
+ },
4533
+ "updated": {
4534
+ "format": "date-time",
4535
+ "type": "string",
4536
+ },
4537
+ },
4538
+ "required": [],
4539
+ "type": "object",
4540
+ },
4541
+ "type": "array",
4542
+ },
4543
+ "created": {
4544
+ "format": "date-time",
4545
+ "type": "string",
4546
+ },
4547
+ "description": {
4548
+ "type": "any",
4549
+ },
4550
+ "eatenBy": {
4551
+ "items": {
4552
+ "$ref": "#/components/schemas/LimitedUser",
4553
+ },
4554
+ "type": "array",
4555
+ },
4556
+ "expiration": {
4557
+ "type": "dateonly",
4558
+ },
4559
+ "foo": {
4560
+ "type": "string",
4561
+ },
4562
+ "hidden": {
4563
+ "type": "boolean",
4564
+ },
4565
+ "lastEatenWith": {
4566
+ "additionalProperties": {
4567
+ "format": "date-time",
4568
+ "type": "string",
4569
+ },
4570
+ "type": "object",
4571
+ },
4572
+ "likesIds": {
4573
+ "items": {
4574
+ "properties": {
4575
+ "_id": {
4576
+ "type": "string",
4577
+ },
4578
+ "likes": {
4579
+ "type": "boolean",
4580
+ },
4581
+ "userId": {
4582
+ "$ref": "#/components/schemas/LimitedUser",
4583
+ },
4584
+ },
4585
+ "required": [],
4586
+ "type": "object",
4587
+ },
4588
+ "type": "array",
4589
+ },
4590
+ "name": {
4591
+ "type": "string",
4592
+ },
4593
+ "ownerId": {
4594
+ "properties": {
4595
+ "email": {
4596
+ "type": "string",
4597
+ },
4598
+ "name": {
4599
+ "type": "string",
4600
+ },
4601
+ },
4602
+ "type": "object",
4603
+ },
4604
+ "source": {
4605
+ "properties": {
4606
+ "dateAdded": {
4607
+ "type": "string",
4608
+ },
4609
+ "href": {
4610
+ "type": "string",
4611
+ },
4612
+ "name": {
4613
+ "type": "string",
4614
+ },
4615
+ },
4616
+ "type": "object",
4617
+ },
4618
+ "tags": {
4619
+ "items": {
4620
+ "type": "string",
4621
+ },
4622
+ "type": "array",
4623
+ },
4624
+ },
4625
+ "type": "object",
4626
+ },
4627
+ },
4628
+ },
4629
+ "required": true,
4630
+ },
4631
+ "responses": {
4632
+ "200": {
4633
+ "content": {
4634
+ "application/json": {
4635
+ "schema": {
4636
+ "properties": {
4637
+ "_id": {
4638
+ "type": "string",
4639
+ },
4640
+ "calories": {
4641
+ "type": "number",
4642
+ },
4643
+ "categories": {
4644
+ "items": {
4645
+ "properties": {
4646
+ "_id": {
4647
+ "type": "string",
4648
+ },
4649
+ "created": {
4650
+ "format": "date-time",
4651
+ "type": "string",
4652
+ },
4653
+ "name": {
4654
+ "type": "string",
4655
+ },
4656
+ "show": {
4657
+ "type": "boolean",
4658
+ },
4659
+ "updated": {
4660
+ "format": "date-time",
4661
+ "type": "string",
4662
+ },
4663
+ },
4664
+ "required": [],
4665
+ "type": "object",
4666
+ },
4667
+ "type": "array",
4668
+ },
4669
+ "created": {
4670
+ "format": "date-time",
4671
+ "type": "string",
4672
+ },
4673
+ "description": {
4674
+ "type": "any",
4675
+ },
4676
+ "eatenBy": {
4677
+ "items": {
4678
+ "$ref": "#/components/schemas/LimitedUser",
4679
+ },
4680
+ "type": "array",
4681
+ },
4682
+ "expiration": {
4683
+ "type": "dateonly",
4684
+ },
4685
+ "foo": {
4686
+ "type": "string",
4687
+ },
4688
+ "hidden": {
4689
+ "type": "boolean",
4690
+ },
4691
+ "lastEatenWith": {
4692
+ "additionalProperties": {
4693
+ "format": "date-time",
4694
+ "type": "string",
4695
+ },
4696
+ "type": "object",
4697
+ },
4698
+ "likesIds": {
4699
+ "items": {
4700
+ "properties": {
4701
+ "_id": {
4702
+ "type": "string",
4703
+ },
4704
+ "likes": {
4705
+ "type": "boolean",
4706
+ },
4707
+ "userId": {
4708
+ "$ref": "#/components/schemas/LimitedUser",
4709
+ },
4710
+ },
4711
+ "required": [],
4712
+ "type": "object",
4713
+ },
4714
+ "type": "array",
4715
+ },
4716
+ "name": {
4717
+ "type": "string",
4718
+ },
4719
+ "ownerId": {
4720
+ "properties": {
4721
+ "email": {
4722
+ "type": "string",
4723
+ },
4724
+ "name": {
4725
+ "type": "string",
4726
+ },
4727
+ },
4728
+ "type": "object",
4729
+ },
4730
+ "source": {
4731
+ "properties": {
4732
+ "dateAdded": {
4733
+ "type": "string",
4734
+ },
4735
+ "href": {
4736
+ "type": "string",
4737
+ },
4738
+ "name": {
4739
+ "type": "string",
4740
+ },
4741
+ },
4742
+ "type": "object",
4743
+ },
4744
+ "tags": {
4745
+ "items": {
4746
+ "type": "string",
4747
+ },
4748
+ "type": "array",
4749
+ },
4750
+ },
4751
+ "required": [
4752
+ "likesIds",
4753
+ "_id",
4754
+ "created",
4755
+ "updated",
4756
+ ],
4757
+ "type": "object",
4758
+ },
4759
+ },
4760
+ },
4761
+ "description": "Successful update",
4762
+ },
4763
+ "400": {
4764
+ "content": {
4765
+ "application/json": {
4766
+ "schema": {
4767
+ "$ref": "#/components/schemas/APIError",
4768
+ },
4769
+ },
4770
+ },
4771
+ "description": "Bad request",
4772
+ },
4773
+ "401": {
4774
+ "description": "The user must be authenticated",
4775
+ },
4776
+ "403": {
4777
+ "content": {
4778
+ "application/json": {
4779
+ "schema": {
4780
+ "$ref": "#/components/schemas/APIError",
4781
+ },
4782
+ },
4783
+ },
4784
+ "description": "The user is not allowed to perform this action on this document",
4785
+ },
4786
+ "404": {
4787
+ "content": {
4788
+ "application/json": {
4789
+ "schema": {
4790
+ "$ref": "#/components/schemas/APIError",
4791
+ },
4792
+ },
4793
+ },
4794
+ "description": "Document not found",
4795
+ },
4796
+ "405": {
4797
+ "content": {
4798
+ "application/json": {
4799
+ "schema": {
4800
+ "$ref": "#/components/schemas/APIError",
4801
+ },
4802
+ },
4803
+ },
4804
+ "description": "The user is not allowed to perform this action on any document",
4805
+ },
4806
+ },
4807
+ "tags": [
4808
+ "foods",
4809
+ ],
4810
+ },
4811
+ },
4812
+ },
4813
+ }
4814
+ `;