-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
199 lines (193 loc) · 5.19 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
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
188
189
190
191
192
193
194
195
196
197
198
199
openapi: 3.1.0
info:
title: Minecraft 日志分析器 API | Minecraft Logs Analyzer API
description: |-
这是一个 [MCLA](https://github.com/GlobeMC/mcla) 的无服务器函数端口
contact:
email: zyxkad@gmail.com
license:
name: AGPL-3.0
url: https://www.gnu.org/licenses/agpl-3.0.html
version: 1.0.0
externalDocs:
description: 前往网页版分析器
url: https://beta.crashmc.com/analyzer.html
servers:
- url: https://api.crashmc.com
- url: https://mcla-serverless.vercel.app
paths:
/v0/analyze:
post:
tags:
- v0
summary: 分析日志并返回匹配的错误
description: 分析日志并返回匹配的错误
parameters:
- in: query
name: match
description: 错误匹配时, 最小的匹配度
schema:
$ref: '#/components/schemas/Possibility'
requestBody:
description: 待分析的日志
content:
text/plain:
schema:
type: string
application/octet-stream:
schema:
type: string
format: binary
application/x-www-form-urlencoded:
schema:
type: string
format: binary
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
encoding:
file:
contentType: text/plain, application/octet-stream
required: true
responses:
'200':
description: 分析成功
content:
application/json:
schema:
$ref: '#/components/schemas/AnalyzedResponse'
'400':
description: 文件提交格式错误
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResp'
'500':
description: 处理日志时出错
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResp'
components:
schemas:
AnalyzeResult:
type: object
properties:
error:
$ref: '#/components/schemas/JavaError'
matched:
type: array
items:
$ref: '#/components/schemas/SolutionPossibility'
file:
type: string
description: 错误所在文件
description: 分析结果
JavaError:
type: object
properties:
class:
type: string
message:
type: string
stacktrace:
$ref: '#/components/schemas/Stacktrace'
causedBy:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/JavaError'
lineNo:
type: integer
minimum: 1
description: Java 错误
StackInfo:
type: object
properties:
raw:
type: string
description: 原始错误栈内容
class:
type: string
description: 错误栈所在的类
method:
type: string
description: 错误栈所在的函数
description: 单行错误栈
Stacktrace:
type: array
items:
$ref: '#/components/schemas/StackInfo'
description: 错误栈
SolutionPossibility:
type: object
properties:
errorDesc:
$ref: '#/components/schemas/ErrorDesc'
match:
$ref: '#/components/schemas/Possibility'
Possibility:
type: number
minimum: 0
maximum: 1
examples: [0.5, 0, 1]
description: 错误匹配度
ErrorDesc:
type: object
properties:
error:
type: string
message:
type: string
solutions:
type: array
items:
type: integer
minimum: 0
description: 解决放案ID
description: 错误描述
AnalyzedResponse:
type: object
properties:
status:
type: string
examples:
- ok
res:
type: array
examples:
-
-
error:
class: 'net.minecraft.util.ResourceLocationException'
message: 'Non [a-z0-9_.-] character in namespace of location: .DS_Store'
stacktrace:
- raw: ' at package.to.Class.method'
class: 'package.to.Class'
method: 'method'
lineNo: 66
matched:
errorDesc:
error: 'net.minecraft.util.ResourceLocationException'
message: 'Non [a-z0-9_.-] character in namespace of location: .DS_Store'
solutions: 1
match: 0.54321
file: latest.log
items:
$ref: '#/components/schemas/AnalyzeResult'
description: 成功响应
ErrorResp:
type: object
properties:
status:
type: string
examples:
- error
error:
type: string
examples:
- Error message
description: 错误响应