-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple.raml
126 lines (125 loc) · 3.65 KB
/
simple.raml
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
#%RAML 0.8
title: New API
version: v1
baseUri: http://192.168.56.1:8000/{version}
mediaType: application/json
documentation:
- title: Introduction
content: |
API to manage the sales and replenishments of stock items and floats in our vending machines.
/sales:
post:
body:
example: |
{
"machineId" : "ZX4102",
"trayId" : "A1",
"dateAndTime" : "2013-10-22 16:17:00",
"exchange" : {
"value" : 450,
"in" : 500,
"out" : 50
}
}
get:
responses:
200:
body:
example: |
{
"count" : 2,
"sales" : [
{
"dateAndTime" : "2013-10-22 16:17:00",
"value" : 450,
"machineId" : "ZX4102",
"productId" : "Cad-CB1012"
},
{
"dateAndTime" : "2013-10-22 16:17:00",
"value" : 150,
"machineId" : "ZX5322",
"productId" : "CC-LB1"
}
],
"totalValue" : 600
}
/machines:
get:
responses:
200:
body:
example: |
{
"count" : 3,
"machines" : [
{
"id" : "ZX4102",
"location" : "Starbuck's, 442 Geary Street, San Francisco, CA 94102"
},
{
"id" : "ZX5322",
"location" : "Starbuck's, 462 Powell Street, San Francisco, CA 94102"
},
{
"id" : "ZX6792",
"location" : "Cafe La Taza, 470 Post Street, San Francisco, CA 94102"
}
]
}
/{machine}:
get:
responses:
200:
body:
example: |
{
"id" : "ZX4102",
"location" : "Starbuck's, 442 Geary Street, San Francisco, CA 94102",
"sales" : [
{
"dateAndTime" : "2013-10-22 16:17:00",
"value" : 450,
"machineId" : "ZX4102",
"productId" : "Cad-CB1012"
},
{
"dateAndTime" : "2013-10-22 16:17:00",
"value" : 150,
"machineId" : "ZX5322",
"productId" : "CC-LB1"
}
],
"floatsToBeReplenished" : [20, 40, 20, 80, 20, 40, 40],
"stockToBeReplenished" : 54
}
/songs:
description: Collection of available songs in Jukebox
get:
description: Get a list of songs based on the song title.
queryParameters:
songTitle:
description: "The title of the song to search (it is case insensitive and doesn't need to match the whole title)"
required: true
minLength: 3
type: string
example: "Get L"
responses:
200:
body:
application/json:
example: |
"songs": [
{
"songId": "550e8400-e29b-41d4-a716-446655440000",
"songTitle": "Get Lucky"
},
{
"songId": "550e8400-e29b-41d4-a716-446655440111",
"songTitle": "Loose yourself to dance"
},
{
"songId": "550e8400-e29b-41d4-a716-446655440222",
"songTitle": "Gio sorgio by Moroder"
}
]