This repository has been archived by the owner on Apr 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
swagger.yaml
300 lines (275 loc) · 8.91 KB
/
swagger.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
swagger: '2.0'
#####################################################################
# API Information #
#####################################################################
info:
title: ISSN-L Resolver
version: "1.0.3"
description: |
Validate ISSN's and ISSN-L's, and converts any ISSN to the correspondent (canonic) ISSN-L.
**ISSN** is a standard public [opaque identifier](https://en.wikipedia.org/wiki/Unique_identifier) for [journals](https://en.wikipedia.org/wiki/Periodical_publication), assigned by the [ISSN-ORG authority](http://www.issn.org). Its main function is to be a short alias for the [systematic name](https://en.wikipedia.org/wiki/Systematic_name) of the journal, uniquely identifying the publication content (*ISSN-L*) or a specific [media type](https://en.wikipedia.org/wiki/Media_(communication)) of the publication. In the latter case, for example, the same journal can have an *eletronic-ISSN* and a *print-ISSN*, which identifies its electronic and printed publications separately.
The **ISSN-L resolver** converts any ISSN to its corresponding [ISSN-L](https://en.wikipedia.org/wiki/ISSN#Linking_ISSN) ("Linking ISSN") using a lightweight SQL structure.
contact:
email: peter@ok.org.br
license:
name: MIT
url: https://opensource.org/licenses/MIT
tags:
- name: checkers
description: Check format and/or existence of the string input.
- name: int-checkers
description: Check format and/or existence of the integer input.
- name: converters
description: Converts string input name to que requested output name.
- name: int-converters
description: Converts integer input name to que requested output name.
- name: metadata-retriev
description: basic information (metadata) retrieval by string input.
- name: int-metadata-retriev
description: basic information (metadata) retrieval by integer input.
parameters:
issn:
name: issn
in: path
description: commom ISSN code.
required: true
type: string
pattern: ^\d{4}-\d{3}[\dxX]$
issn7:
name: issn7
in: path
description: the first 7 digits of the ISSN code.
required: true
type: integer
format: int32
minimum: 1
maximum: 9999999
definitions:
ArrayOfInt:
type: array
items:
type: integer
ArrayOfStr:
type: array
items:
type: string
#####################################################################
# PATHS #
#####################################################################
paths:
/{issn}/isC:
get:
tags:
- checkers
summary: Check that input is an ISSN-L.
operationId: isC-str
description: |
Check that input is a Linking ISSN (an ISSN-L). The error 404 needs an updated database, to be an real "ISSN not exists".
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn'
responses:
200:
description: search results matching criteria
schema:
type: boolean
404:
description: has not found the input issn.
416:
description: issn format is invalid.
/{issn}/isN:
get:
tags:
- checkers
summary: Check that input is an ISSN (existis in the database).
operationId: isN-str
description: |
Check that the Name (ISSN) exists, returning true. When input is out of range returns null, else the boolean false indicates "not found".
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn'
responses:
200:
description: search results matching criteria
schema:
type: boolean
404:
description: has not found the requested issn.
416:
description: issn out of range (null, 0 or big)
/int/{issn7}/isC:
get:
tags:
- int-checkers
summary: Check that input is an ISSN-L.
operationId: isC-int
description: |
Check that input is a Linking ISSN (an ISSN-L). The error 404 needs an updated database, to be an real "ISSN not exists".
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn7'
responses:
200:
description: search results matching criteria
schema:
type: boolean
404:
description: has not found the requested issn.
416:
description: issn out of range (null, 0 or big)
/int/{issn7}/isN:
get:
tags:
- int-checkers
summary: Check that input is an ISSN (existis in the database).
operationId: isN-int
description: |
Check that the Name (ISSN) exists, returning true. When input is out of range returns null, else the boolean false indicates "not found".
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn7'
responses:
200:
description: search results matching criteria
schema:
type: boolean
404:
description: has not found the requested issn.
416:
description: issn out of range (null, 0 or big)
/{issn}/N2C:
get:
tags:
- converters
summary: Converts input ISSN code into its ISSN-L.
operationId: N2C-str
description: |
Converts commom ISSN input into a corresponding Linking ISSN (an ISSN-L).
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn'
responses:
200:
description: search results matching criteria
schema:
type: string
404:
description: has not found the input issn.
416:
description: issn format is invalid.
/{issn}/N2Ns:
get:
tags:
- converters
summary: Converts input ISSN code into a set of ISSNs grouped by its ISSN-L.
operationId: N2Ns-str
description: |
Converts commom ISSN input into a corresponding "grouped by ISSN-L" set of ISSNs.
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn'
responses:
200:
description: search results matching criteria
schema:
$ref: "#/definitions/ArrayOfStr"
404:
description: has not found the input issn.
416:
description: issn format is invalid.
/int/{issn7}/N2C:
get:
tags:
- int-converters
summary: Converts integer input into its ISSN-L.
operationId: N2C-int
description: |
Converts Converts integer input (representing an ISSN code) into a corresponding Linking ISSN (an ISSN-L).
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn7'
responses:
200:
description: search results matching criteria
schema:
type: integer
404:
description: has not found the input issn.
416:
description: issn format is invalid.
/int/{issn7}/N2Ns:
get:
tags:
- int-converters
summary: Converts integer input into all set of ISSNs grouped by its ISSN-L.
operationId: N2Ns-int
description: |
Converts Converts integer input (representing an ISSN code) into a corresponding "group by ISSN-L" set of ISSNs.
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn7'
responses:
200:
description: search results matching criteria
schema:
$ref: "#/definitions/ArrayOfInt"
404:
description: has not found the input issn.
416:
description: issn format is invalid.
/info:
get:
tags:
- full
summary: show metadata about current ISSN database.
operationId: infoDB
description: |
Information about ISSN database. Not use REST status codes.
produces:
- application/json
- application/xml
responses:
200:
description: retrieve information
schema:
type: object
/{issn}/info:
get:
tags:
- full
summary: When input exist, returns all basic metadata about it.
operationId: info
description: |
Supply all basic metadata about input and, when not exist, explain in a error message. Not use REST status codes.
produces:
- application/json
- application/xml
parameters:
- $ref: '#/parameters/issn'
responses:
200:
description: retrieve information
schema:
type: object
# Added by API Auto Mocking Plugin
host: api.ok.org.br
basePath: /issn
schemes:
- http
- https