-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
192 lines (183 loc) · 5.47 KB
/
openapi.yaml
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
openapi: 3.0.3
info:
title: Similarity score api for MassBank3
description:
This similarity score api for MassBank3 calculates the spectral similarity
between the spectrum defined in the query peak list and the reference spectra
list.
version: "0.1"
servers:
- url: http://localhost:8080
description: Local server
paths:
/version:
get:
summary: Get the version string of the implementation.
x-openapi-router-controller: similarity_service_impl.similarity_service_impl_controller
operationId: version_get
responses:
"200":
description: version string
content:
application/json:
schema:
type: string
example: similarity service 0.1
/similarity:
post:
summary: Create a new similarity calculation.
x-openapi-router-controller: similarity_service_impl.similarity_service_impl_controller
operationId: similarity_post
requestBody:
description: a similarity job
required: true
x-body-name: similarity_calculation
content:
application/json:
schema:
$ref: "#/components/schemas/similarity_calculation"
responses:
"200":
description: Similarity job successfully calculated.
content:
application/json:
schema:
$ref: "#/components/schemas/similarity_score_list"
"400":
description: The server can not process the input.
content:
application/problem+json:
schema:
$ref: "#/components/schemas/error"
"503":
description: The server is not ready to handle the request.
content:
application/problem+json:
schema:
$ref: "#/components/schemas/error"
"500":
description: The server encountered an unexpected condition.
content:
application/problem+json:
schema:
$ref: "#/components/schemas/error"
components:
schemas:
peak:
description: a peak with m/z and intensity
title: peak
type: object
properties:
mz:
type: number
intensity:
type: number
required:
- mz
- intensity
example:
mz: 147.063
intensity: 121.684
peak_list:
title: peak_list
type: object
properties:
peak_list:
type: array
items:
$ref: "#/components/schemas/peak"
example:
- mz: 147.063
intensity: 121.684
- mz: 303.050
intensity: 10000.000
- mz: 449.108
intensity: 657.368
- mz: 465.102
intensity: 5884.210
- mz: 611.161
intensity: 6700.000
required:
- peak_list
reference_spectra_list:
description: the reference spectra list, list of ACCESSION strings
title: reference_spectra_list
type: object
properties:
reference_spectra_list:
type: array
items:
type: string
example:
- MSBNK-IPB_Halle-PB001341
- MSBNK-IPB_Halle-PB006202
- MSBNK-IPB_Halle-PB006203
- MSBNK-IPB_Halle-PB001342
- MSBNK-IPB_Halle-PB001343
similarity_fn:
description: a supported similarity function
title: similarity_fn
type: object
properties:
similarity_fn:
type: string
enum:
- cosine
example: cosine
similarity_calculation:
description: a similarity calculation
title: similarity_calculation
allOf:
- $ref: "#/components/schemas/peak_list"
- $ref: "#/components/schemas/reference_spectra_list"
- $ref: "#/components/schemas/similarity_fn"
similarity_score:
description: the similarity score to a reference spectrum
title: similarity_score
type: object
properties:
accession:
type: string
similarity_score:
type: number
example:
accession: MSBNK-IPB_Halle-PB001341
similarity_score: 0.3
similarity_score_list:
description: the similarity score list, result of a similarity calculation
title: similarity_score_list
type: object
properties:
similarity_score_list:
type: array
items:
$ref: "#/components/schemas/similarity_score"
example:
- accession: MSBNK-IPB_Halle-PB001341
similarity_score: 0.3
- accession: MSBNK-IPB_Halle-PB006202
similarity_score: 0.5
- accession: MSBNK-IPB_Halle-PB006203
similarity_score: 0.5
- accession: MSBNK-IPB_Halle-PB001342
similarity_score: 0.9
- accession: MSBNK-IPB_Halle-PB001343
similarity_score: 0.8
error:
description: an error response
title: error
type: object
properties:
status:
type: number
title:
type: string
detail:
type: string
type:
type: string
example:
status: 500
title: "Database Error"
detail: "connection failed: connection to server at \"127.0.0.1\", port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?"
type: "about:blank"