-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopen-api.yml
101 lines (98 loc) · 2.4 KB
/
open-api.yml
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
openapi: 3.0.0
servers:
- description: ESP32 Basic API contract
url: https://virtserver.swaggerhub.com/paveldhq/thermo-esp32/1.0.0
info:
version: "1.0.0"
title: thermo-esp32
description: ESP32 API for FW update and WI-FI management
paths:
# // todo: add support for PIN 3-6 digit code, default 0000
# /identity:
/firmware:
post:
tags:
- Firmware
description: Updates firmware
operationId: updateFirmware
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
fileName:
type: string
format: binary
responses:
'200':
description: File uploaded
/wifi/list:
get:
tags:
- WiFi
description: Returs list of available APs
responses:
'200':
description: All visible APs
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/WifiSettings'
/wifi/settings:
get:
tags:
- WiFi
description: Returns current wifi settings
responses:
'200':
description: Current settings
content:
application/json:
schema:
$ref: '#/components/schemas/WifiSettings'
post:
tags:
- WiFi
requestBody:
description: Sets cerrent settings
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WifiSettings'
responses:
'201':
description: Applied
delete:
tags:
- WiFi
description: Clears current wifi settings
responses:
'200':
description: Resets settings
content:
application/json:
schema:
$ref: '#/components/schemas/WifiSettings'
components:
schemas:
WifiModeType:
type: string
enum: [client, ap]
WifiProtectionType:
type: string
enum: [none, wep, wpa]
WifiSettings:
type: object
properties:
mode:
$ref: '#/components/schemas/WifiModeType'
protection:
$ref: '#/components/schemas/WifiProtectionType'
ssid:
type: string
password:
type: string