-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.json
More file actions
187 lines (184 loc) · 5.52 KB
/
swagger.json
File metadata and controls
187 lines (184 loc) · 5.52 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
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
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Shaking Hands Overseas API",
"description": "API used to move a hand from the other side of the world using LucasVR glove",
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
}
},
"host": "",
"schemes":["http", "https"],
"basePath": "/",
"tags": [
{
"name": "1.0",
"description": "API Version 1.0. Can only be used by one device at a time"
}
],
"paths": {
"/1/receiver":{
"get": {
"summary": "Receive the stored sensor data in server",
"tags": [
"1.0"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Data Received",
"examples": {
"application/json": "{\"s1\": \"0\",\n \"s2\": \"1\",\n\"s3\": \"2\",\n\"s4\": \"3\",\n\"s5\": \"4\",\n\"b1\": \"1\",\n\"b2\": \"1\"}"
},
"schema": {
"$ref": "#/definitions/SensorData"
}
},
"401":{
"description": "401 Error"
},
"404":{
"description": "404 Error"
},
"500":{
"description": "500 Error"
}
}
}
},
"/1/servo":{
"post": {
"summary": "Send sensor data to the server",
"description":"Data sent as a JSON file containing each sensor data will be stored as a local variable which you can read using /receiver",
"tags": [
"1.0"
],
"parameters": [
{
"name": "Send sensor data to the server",
"in": "body",
"description": "Data sent as a JSON file containing each sensor data will be stored as a local variable which you can read using /receiver",
"required": true,
"schema": {
"$ref": "#/definitions/SensorData"
}
}],
"responses": {
"200": {
"description": "Data Received",
"examples": {
"application/json": "{\"s1\": \"0\",\n \"s2\": \"1\",\n\"s3\": \"2\",\n\"s4\": \"3\",\n\"s5\": \"4\"}"
},
"schema": {
"$ref": "#/definitions/SensorData"
}
},
"401":{
"description": "401 Error"
},
"404":{
"description": "404 Error"
},
"500":{
"description": "500 Error"
}
}
}
},
"/1/buttons":{
"post": {
"summary": "Send button data to the server",
"description":"Data sent as a JSON file containing each button data will be stored as a local variable which you can read using /receiver",
"tags": [
"1.0"
],
"parameters": [
{
"name": "Send button data to the server",
"in": "body",
"description": "Data sent as a JSON file containing each button data will be stored as a local variable which you can read using /receiver",
"required": true,
"schema": {
"$ref": "#/definitions/ButtonData"
}
}],
"responses": {
"200": {
"description": "Data Received",
"examples": {
"application/json": "{\"b1\": \"0\",\n \"b2\": \"1\"}"
},
"schema": {
"$ref": "#/definitions/ButtonData"
}
},
"401":{
"description": "401 Error"
},
"404":{
"description": "404 Error"
},
"500":{
"description": "500 Error"
}
}
}
}
},
"definitions":{
"SensorData": {
"type": "object",
"required": [
"name"
],
"properties": {
"s1": {
"type": "integer",
"format": "int64"
},
"s2": {
"type": "integer",
"format": "int64"
},
"s3": {
"type": "integer",
"format": "int64"
},
"s4": {
"type": "integer",
"format": "int64"
},
"s5": {
"type": "integer",
"format": "int64"
}
},
"schemes": ["http"],
"consumes": ["application/json"],
"produces": ["application/json"]
},
"ButtonData": {
"type": "object",
"required": [
"name"
],
"properties": {
"b1": {
"type": "integer",
"format": "int64"
},
"b2": {
"type": "integer",
"format": "int64"
}
},
"schemes": ["http"],
"consumes": ["application/json"],
"produces": ["application/json"]
}
}
}