-
Notifications
You must be signed in to change notification settings - Fork 29
/
schema.json
583 lines (583 loc) · 18.2 KB
/
schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
{
"$schema": "http://json-schema.org/draft-07/schema",
"definitions": {
"none": {
"type": "string",
"enum": [
"none",
"None"
]
},
"note": {
"type": "string"
},
"unit": {
"type": "string",
"title": "Unit",
"examples": [
"cups",
"tsp",
"g",
"kg",
"l",
"dl",
"cl",
"each"
]
},
"usda_num": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string",
"pattern": "^[0-9]+$"
}
],
"description": "This corresponds with the index keys in the USDA Standard Reference. It is generally used for easy lookup of nutritional data. If possible, this should be used, and USDA data, when available, is preferable to any other nutritional data source."
},
"step": {
"type": "object",
"properties": {
"step": {
"type": "string",
"description": "Description of the step."
},
"notes": {
"type": "array",
"items": {
"$ref": "#/definitions/note"
},
"description": "A list of notes relevant to this step. Often known as “bench notes” to professionals."
},
"haccp": {
"type": "object",
"properties": {
"control_point": {
"type": "string",
"description": "Refers to specific HACCP guidelines relevant to this step."
},
"critical_control_point": {
"type": "string",
"description": "Refers to specific HACCP guidelines relevant to this step, which are critical to the safety outcome of this recipe."
}
},
"description": "Can contain either a control_point or a critical_control_point. Should not contain both.",
"minProperties": 1,
"maxProperties": 1
}
},
"required": [
"step"
],
"additionalProperties": false,
"description": "Describes step to be performed on the recipe."
},
"ingredient": {
"type": "object",
"patternProperties": {
"^[a-zA-Z ]*$": {
"type": "object",
"properties": {
"amounts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
}
],
"description": "The amount of the unit to use."
},
"unit": {
"$ref": "#/definitions/unit",
"description": "The unit, relevant to the amount."
}
},
"required": [
"amount",
"unit"
],
"additionalProperties": false
},
"description": "A list of dicts which describe the amounts to use. Normally, the list will only contain one dict. In cases where multiple yields need to be stored (i.e. 50 cookies vs 100 cookes vs 250 cookies), each yield will have its own dict in this list, in the same order as the recipe’s yield field."
},
"processing": {
"type": "array",
"items": {
"type": "string"
},
"description": "A list of tags which describe the processing of this item. For instance, “whole”, “large dice”, “minced”, “raw”, “steamed”, etc.",
"examples": [
"whole",
"diced",
"minced",
"steamed",
"raw"
]
},
"notes": {
"type": "array",
"items": {
"$ref": "#/definitions/note"
},
"description": "Any notes specific to this ingredient"
},
"substitutions": {
"type": "array",
"items": {
"$ref": "#/definitions/ingredient"
},
"description": "This field is a list of ingredients, in exactly the same format as a regular ingredient list item, minus the substitutions field."
},
"usda_num": {
"$ref": "#/definitions/usda_num",
"description": "This corresponds with the index keys in the USDA Standard Reference. It is generally used for easy lookup of nutritional data. If possible, this should be used, and USDA data, when available, is preferable to any other nutritional data source."
}
},
"required": [
"amounts"
],
"additionalProperties": false
}
},
"minProperties": 1,
"maxProperties": 1
}
},
"type": "object",
"properties": {
"recipe_name": {
"type": "string",
"description": "The name of this recipe."
},
"notes": {
"type": "array",
"items": {
"$ref": "#/definitions/note"
},
"description": "General notes about the recipe."
},
"steps": {
"type": "array",
"items": {
"$ref": "#/definitions/step"
},
"description": "A list, in order, of steps to be performed on the recipe."
},
"ingredients": {
"type": "array",
"items": {
"$ref": "#/definitions/ingredient"
},
"description": "A list of dicts, defining which food items are to be added to the recipe. These items should be listed in the order in which they are to be used. Bearing this in mind, a particular item may be listed multiple times, if it is to be used multiple times and/or at different quantities in a recipe."
},
"oven_fan": {
"oneOf": [
{
"$ref": "#/definitions/none"
},
{
"type": "string",
"enum": [
"Off",
"Low",
"High"
]
}
],
"description": "Setting to be used with convection oven. Possible values are “Off”, “Low” and “High”. If not specified, it is assumed to be “Off”. If specified, all software should display and print this value. If not specified, it is up to the software whether or not it is displayed and/or printed, but it should be consistent."
},
"oven_temp": {
"oneOf": [
{
"$ref": "#/definitions/none"
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "number"
},
"unit": {
"type": "string",
"enum": [
"C",
"F"
]
}
},
"minProperties": 2,
"maxProperties": 2
}
}
],
"description": "Starting oven temperature, if the oven is used."
},
"oven_time": {
"description": "How long the dish should spend in the oven. This is an overall value, which refers to the recipe as a whole. If multiple oven times are used, they should be specified in the recipe."
},
"recipe_uuid": {},
"source_book": {
"oneOf": [
{
"type": "object",
"properties": {
"authors": {
"type": "array",
"items": {
"type": "string"
},
"description": "This is a list. Refers to the author(s) of this recipe. Can be the same as source_authors, if appropriate. If there was only one author, then they would be the only item in the list."
},
"title": {
"type": "string",
"description": "Title of the book. This is a single value, not a list."
},
"isbn": {
"type": "string",
"description": "International Standard Book Number, if available."
},
"notes": {
"type": "array",
"items": {
"$ref": "#/definitions/note"
},
"description": "Any information about the book that does not fit into another field."
}
},
"patternProperties": {
"^X-.*$": {
"description": "A lot of different information about a book can be stored. Until a field has been officially accepted into the spec, it should start with a capital X, followed by a dash."
}
},
"additionalProperties": false,
"required": [
"title",
"authors"
]
},
{
"$ref": "#/definitions/none"
}
],
"description": "If this recipe was originally pulled from a book, then the book information should go here. Recipe software should make an intelligent effort to include correct information in the correct fields, rather than just dumping everything into a generic notes field."
},
"source_authors": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
],
"description": "Does not refer to the person who entered the recipe; only refers to the original author of the recipe. If this recipe was based on another recipe by another person, then this field should contain the name of the original author."
},
"source_url": {
"type": "string",
"description": "The URL that this recipe was copied from, if applicable. In the case of a recipe-hosting website, this may refer to the official URL at which the recipe is hosted."
},
"yields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "number"
},
"unit": {
"$ref": "#/definitions/unit"
}
},
"dependencies": {
"amount": {
"required": [
"unit"
]
}
},
"additionalProperties": {
"type": "number"
},
"maxProperties": 2
},
"description": "Refers to how much food the recipe makes. This is a list, which will normally contain one dict. In cases where multiple yields need to be stored (i.e. 50 cookies vs 100 cookes vs 250 cookies), each yield will have its own dict in this list."
},
"author": {
"type": "string"
},
"nutrition": {
"type": "object",
"patternProperties": {
"^[a-zA-Z ]*$": {
"type": "array",
"items": {
"type": "object",
"properties": {
"unit": {
"$ref": "#/definitions/unit"
},
"amount": {
"type": "number"
},
"usda_name": {
"type": "string"
},
"usda_num": {
"$ref": "#/definitions/usda_num"
},
"proximates": {
"type": "object",
"properties": {
"water": {
"type": "number"
},
"energy": {
"type": "number"
},
"protein": {
"type": "number"
},
"lipid_total": {
"type": "number"
},
"ash": {
"type": "number"
},
"carbohydrate": {
"type": "number"
},
"fiber_total": {
"type": "number"
},
"sugars_total": {
"type": "number"
},
"sucrose": {
"type": "number"
},
"glucose": {
"type": "number"
},
"fructose": {
"type": "number"
},
"lactose": {
"type": "number"
},
"maltose": {
"type": "number"
},
"galactose": {
"type": "number"
},
"starch": {
"type": "number"
}
},
"additionalProperties": false
},
"minerals": {
"type": "object",
"properties": {
"calcium": {
"type": "number"
},
"iron": {
"type": "number"
},
"magnesium": {
"type": "number"
},
"phosphorus": {
"type": "number"
},
"potassium": {
"type": "number"
},
"sodium": {
"type": "number"
},
"zinc": {
"type": "number"
},
"copper": {
"type": "number"
},
"manganese": {
"type": "number"
},
"selenium": {
"type": "number"
},
"flouride": {
"type": "number"
}
},
"additionalProperties": false
},
"vitamins": {
"type": "object",
"properties": {
"vitamin_c": {
"type": "number"
},
"thiamin": {
"type": "number"
},
"riboflavin": {
"type": "number"
},
"niacin": {
"type": "number"
},
"pantothenic_acid": {
"type": "number"
},
"vitamin_b6": {
"type": "number"
},
"folate_total": {
"type": "number"
},
"folic_acid": {
"type": "number"
},
"folate_food": {
"type": "number"
},
"folate_dfe": {
"type": "number"
},
"choline_total": {
"type": "number"
},
"betaine": {
"type": "number"
},
"vitamin_b12": {
"type": "number"
},
"vitamin_b12_added": {
"type": "number"
},
"vitamin_a_rae": {
"type": "number"
},
"retinol": {
"type": "number"
},
"carotene_beta": {
"type": "number"
},
"carotene_alpha": {
"type": "number"
},
"cryptoxanthin_beta": {
"type": "number"
},
"vitamin_a_iu": {
"type": "number"
},
"lycopene": {
"type": "number"
},
"lutein_zeaxanthin": {
"type": "number"
},
"vitamin_e_alpha_tocopherol": {
"type": "number"
},
"vitamin_e_added": {
"type": "number"
},
"vitamin_e": {
"type": "number"
},
"tocopherol_beta": {
"type": "number"
},
"tocopherol_gamma": {
"type": "number"
},
"tocopherol_delta": {
"type": "number"
},
"vitamin_d2_d3": {
"type": "number"
},
"vitamin_d_ergocalciferol": {
"type": "number"
},
"vitamin_d_cholecalciferol": {
"type": "number"
},
"vitamin_d": {
"type": "number"
},
"vitamin_k": {
"type": "number"
},
"menaquinone_4": {
"type": "number"
}
},
"additionalProperties": false
},
"lipids": {
"type": "object",
"properties": {
"total_saturated": {
"type": "number"
},
"total_monounsaturated": {
"type": "number"
},
"total_polyunsaturated": {
"type": "number"
},
"cholesterol": {
"type": "number"
}
},
"additionalProperties": false
},
"other": {
"type": "object",
"properties": {
"caffeine": {
"type": "number"
}
}
}
}
}
}
}
}
},
"patternProperties": {
"^X-[a-zA-z]+$": {
"description": "A lot of different information about a recipe can be stored. Until a field has been officially accepted into the spec, it should start with a capital X, followed by a dash."
}
},
"required": [
"recipe_name",
"steps",
"ingredients"
],
"additionalProperties": false
}