forked from TooeleTechSoftDev/PizzaTime-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproductSchema.json
More file actions
65 lines (65 loc) · 1.99 KB
/
productSchema.json
File metadata and controls
65 lines (65 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Product schema",
"examples": [
{
"productId": 789,
"orderType": "pizza",
"itemName": "Hawaiian",
"size": "Large",
"pricePerItem": 12
},
{
"productId": 345,
"orderType": "drink",
"itemName": "Coke",
"size": "Small",
"pricePerItem": 1.5
},
{
"productId": 567,
"orderType": "coupons",
"itemName": "July2019Promo",
"pricePerItem": -3.0
},
{
"productId": 678,
"orderType": "fees",
"itemName": "Delivery Charge",
"pricePerItem": 2.0
}
],
"type": "object",
"required": [ "productId", "orderType", "itemName", "price" ],
"additionalProperties": false,
"properties": {
"productId": {
"type": "integer",
"description": "productId must be an integer"
},
"orderType": {
"type": "string",
"maxLength": 50,
"pattern": "^[\\w \\.,']*$",
"description": "Order type must be no more than 50 characters and contain alphanumerics or these symbols: _.,'"
},
"itemName": {
"type": "string",
"maxLength": 50,
"pattern": "^[\\w \\.,']*$",
"description": "Item's name must be no more than 50 characters and contain alphanumerics or these symbols: _.,'"
},
"size": {
"type": "string",
"maxLength": 20,
"pattern": "^[\\w \\.,']*$",
"description": "Item's size must be no more than 20 characters and contain alphanumerics or these symbols: _.,'"
},
"price": {
"type": "number",
"minimum": -1000,
"maximum": 1000,
"description": "price must be a number between -1000 and +1000"
}
}
}