-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathapispec.yml
135 lines (128 loc) · 3.14 KB
/
apispec.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
swagger: "2.0"
info:
version: 1.0.0
title: Pandora API
license:
name: MIT
host: tsvbits.com
basePath: /
schemes:
- http
consumes:
- application/json
- application/graphql
produces:
- application/json
paths:
# authentication
/api/login:
post:
summary: Create JWT token to access pandora resources
operationId: login
responses:
"200":
description: JSON object with JWT token
default:
description: unexpected error
schema:
$ref: "#/definitions/Error"
# current user info
/api/me:
get:
summary: get information about currently authenticated user based on JWT token provided in Authorization header
operationId: me
responses:
"200":
description: JSON object with user info
# GraphQL+- request
/api/data/query:
post:
summary: GraphQL+- (dgraph query language) to request any information from dgraph database
operationId: query
responses:
"200":
description: usually array of JSON objects with requested information
# user resource
/api/data/user/list:
get:
summary: get paged array of users
operationId: listUsers
parameters:
- name: offset
in: query
description: index of first item
required: false
type: integer
format: int32
- name: limit
in: query
description: how many items to return at one time (max 100)
required: false
type: integer
format: int32
responses:
"200":
description: JSON object with paged array of users
/api/data/user/{userId}:
get:
summary: get user info by given user id
operationId: getUserById
parameters:
- name: userId
in: path
required: true
description: the id of the user to retrieve
type: string
responses:
"200":
description: JSON object with user info
put:
summary: partial update user info by given user id
operationId: updateUserById
parameters:
- name: userId
in: path
required: true
description: the id of the user to update
type: string
responses:
"200":
description: JSON object with user info
/api/data/user:
post:
summary: create new user entity
operationId: createUser
responses:
"200":
description: JSON object with new user info
# file api
/api/file/{path}:
get:
summary: download given file
operationId: downloadFile
responses:
"200":
description: file contents
post:
summary: upload given file
operationId: uploadFile
responses:
"200":
description: JSON object with file info
delete:
summary: delete given file
operationId: deleteFile
responses:
"200":
description: empty result
definitions:
Error:
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string