File size: 2,991 Bytes
33b10b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# api/schemas.py
label_reader_schema = {
    "name": "label_reader",
    "schema": {
        "type": "object",
        "properties": {
            "productName": {"type": "string"},
            "brandName": {"type": "string"},
            "ingredients": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {"type": "string"},
                        "percent": {"type": "string"},
                        "metadata": {"type": "string"},
                    },
                    "required": ["name", "percent", "metadata"],
                    "additionalProperties": False
                }
            },
            "servingSize": {
                "type": "object",
                "properties": {
                    "quantity": {"type": "number"},
                    "unit": {"type": "string"},
                },
                "required": ["quantity", "unit"],
                "additionalProperties": False
            },
            "packagingSize": {
                "type": "object",
                "properties": {
                    "quantity": {"type": "number"},
                    "unit": {"type": "string"},
                },
                "required": ["quantity", "unit"],
                "additionalProperties": False
            },
            "servingsPerPack": {"type": "number"},
            "nutritionalInformation": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {"type": "string"},
                        "unit": {"type": "string"},
                        "values": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "base": {"type": "string"},
                                    "value": {"type": "number"},
                                },
                                "required": ["base", "value"],
                                "additionalProperties": False
                            }
                        },
                    },
                    "required": ["name", "unit", "values"],
                    "additionalProperties": False
                },
                "additionalProperties": True,
            },
            "fssaiLicenseNumbers": {"type": "array", "items": {"type": "number"}},
            "claims": {"type": "array", "items": {"type": "string"}},
            "shelfLife": {"type": "string"},
        },
        "required": [
            "productName", "brandName", "ingredients", "servingSize",
            "packagingSize", "servingsPerPack", "nutritionalInformation",
            "fssaiLicenseNumbers", "claims", "shelfLife"
        ],
        "additionalProperties": False
    },
    "strict": True
}