-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
181 lines (181 loc) · 5.52 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
openapi: 3.0.3
info:
title: Anyops - OpenAPI
version: 1.0.0
description: >
This specification is still a work in progress and is not yet implemented in any API. The purpose of this
specification is to facilitate developers discussions.
contact:
email: [email protected]
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
externalDocs:
description: Anyops documentation
url: https://www.anyops.bhuwanupadhyay.github.io/docs
tags:
- name: User
description: User API endpoints
paths:
/user/authenticate:
summary: User authentication
description: User can authenticate themselves with their username and password
post:
operationId: userAuthentication
summary: Authenticate user
description: >
Exchange username and password to an authentication token.
The token can be later used as authentication mechanism for other API endpoints.
tags:
- User
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UserAuthenticationRequest"
responses:
"200":
description: Successful authentication
content:
application/json:
schema:
$ref: "#/components/schemas/UserAuthenticationResponse"
"403":
description: Invalid credentials
content:
application/json:
schema:
$ref: "#/components/schemas/CommonError"
example:
message: Username and password did not match
components:
schemas:
CommonError:
type: object
properties:
message:
title: message
description: Description for user why a certain operation failed
type: string
GenericApiResponse:
title: GenericApiResponse
type: object
properties:
status:
type: string
enum:
- 100 CONTINUE
- 101 SWITCHING_PROTOCOLS
- 102 PROCESSING
- 103 CHECKPOINT
- 200 OK
- 201 CREATED
- 202 ACCEPTED
- 203 NON_AUTHORITATIVE_INFORMATION
- 204 NO_CONTENT
- 205 RESET_CONTENT
- 206 PARTIAL_CONTENT
- 207 MULTI_STATUS
- 208 ALREADY_REPORTED
- 226 IM_USED
- 300 MULTIPLE_CHOICES
- 301 MOVED_PERMANENTLY
- 302 FOUND
- 302 MOVED_TEMPORARILY
- 303 SEE_OTHER
- 304 NOT_MODIFIED
- 305 USE_PROXY
- 307 TEMPORARY_REDIRECT
- 308 PERMANENT_REDIRECT
- 400 BAD_REQUEST
- 401 UNAUTHORIZED
- 402 PAYMENT_REQUIRED
- 403 FORBIDDEN
- 404 NOT_FOUND
- 405 METHOD_NOT_ALLOWED
- 406 NOT_ACCEPTABLE
- 407 PROXY_AUTHENTICATION_REQUIRED
- 408 REQUEST_TIMEOUT
- 409 CONFLICT
- 410 GONE
- 411 LENGTH_REQUIRED
- 412 PRECONDITION_FAILED
- 413 PAYLOAD_TOO_LARGE
- 413 REQUEST_ENTITY_TOO_LARGE
- 414 URI_TOO_LONG
- 414 REQUEST_URI_TOO_LONG
- 415 UNSUPPORTED_MEDIA_TYPE
- 416 REQUESTED_RANGE_NOT_SATISFIABLE
- 417 EXPECTATION_FAILED
- 418 I_AM_A_TEAPOT
- 419 INSUFFICIENT_SPACE_ON_RESOURCE
- 420 METHOD_FAILURE
- 421 DESTINATION_LOCKED
- 422 UNPROCESSABLE_ENTITY
- 423 LOCKED
- 424 FAILED_DEPENDENCY
- 425 TOO_EARLY
- 426 UPGRADE_REQUIRED
- 428 PRECONDITION_REQUIRED
- 429 TOO_MANY_REQUESTS
- 431 REQUEST_HEADER_FIELDS_TOO_LARGE
- 451 UNAVAILABLE_FOR_LEGAL_REASONS
- 500 INTERNAL_SERVER_ERROR
- 501 NOT_IMPLEMENTED
- 502 BAD_GATEWAY
- 503 SERVICE_UNAVAILABLE
- 504 GATEWAY_TIMEOUT
- 505 HTTP_VERSION_NOT_SUPPORTED
- 506 VARIANT_ALSO_NEGOTIATES
- 507 INSUFFICIENT_STORAGE
- 508 LOOP_DETECTED
- 509 BANDWIDTH_LIMIT_EXCEEDED
- 510 NOT_EXTENDED
- 511 NETWORK_AUTHENTICATION_REQUIRED
timestamp:
title: Timestamp
type: string
format: date-time
example: 2018-11-13T20:20:39+00:00
message:
type: string
debugMessage:
type: string
result:
type: string
data:
type: object
UserAuthenticationRequest:
type: object
required:
- username
- password
properties:
username:
type: string
title: username
description: Username
example: [email protected]
password:
title: password
type: string
example: password123
UserAuthenticationResponse:
type: object
required:
- token
- tokenType
properties:
token:
title: token
description: Klaw authentication token
type: string
minLength: 256
maxLength: 2048
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
tokenType:
title: Token type
example: JWT
type: string
enum: [JWT]