-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.yml
159 lines (158 loc) · 4.72 KB
/
openapi.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
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
openapi: 3.0.0
info:
title: Compilet Server API
description: This is the API for the Compilet Server, which is a web service that compiles code into WebAssembly (wasm) format.
version: 0.0.0
contact:
name: Jacob Lin
url: http://github.com/JacobLinCool
email: [email protected]
servers:
- url: "{protocol}://{host}:{port}"
description: The compilet server
variables:
protocol:
default: https
host:
default: localhost
port:
default: "443"
paths:
/:
get:
summary: Root path
responses:
"200":
description: A brief text message
content:
text/plain:
schema:
type: string
/system:
get:
summary: Get system information
responses:
"200":
description: A JSON object containing system information
content:
application/json:
schema:
$ref: "#/components/schemas/SystemInfo"
/info:
get:
summary: Get server information
responses:
"200":
description: A JSON object containing server information
content:
application/json:
schema:
$ref: "#/components/schemas/ServerInfo"
/validate:
get:
summary: Validate JWT token
security:
- bearerAuth: []
responses:
"200":
description: A boolean value indicating if the token is valid
content:
application/json:
schema:
type: boolean
"401":
description: Unauthorized
/compile:
post:
summary: Compile code to wasm format
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CodeSubmission"
responses:
"200":
description: The result of the compilation process
content:
application/json:
schema:
$ref: "#/components/schemas/CompileResult"
"400":
description: Bad request
"401":
description: Unauthorized
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
SystemInfo:
type: object
properties:
capabilities:
type: object
additionalProperties:
type: string
description: A string describing the compiler settings
status:
$ref: "#/components/schemas/Status"
required:
- capabilities
- status
Status:
type: object
properties:
compiling:
type: integer
format: int32
pending:
type: integer
format: int32
required:
- compiling
- pending
ServerInfo:
type: object
properties:
version:
type: string
commit:
type: string
data:
type: string
os:
type: string
required:
- version
- commit
- data
- os
CodeSubmission:
type: object
properties:
lang:
type: string
code:
type: string
required:
- lang
- code
CompileResult:
type: object
properties:
success:
type: boolean
message:
type: string
hash:
type: string
wasm:
type: string
required:
- success
- message