This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
openapi.yml
176 lines (166 loc) · 4.15 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
openapi: 3.0.0
info:
version: 1.0.0
title: NCrypt API
description: NCrypt API documentation
servers:
- url: https://api.ncrypt.site/api/v1
paths:
/note/{id}:
get:
description: Retrieve a note and probably destory it after retrieval
parameters:
- in: path
name: id
schema:
type: string
format: uuid
required: true
description: secure note id
responses:
'200':
description: Note data decrypted
content:
application/json:
schema:
$ref: '#/components/schemas/RetrieveNoteResponse'
'400':
description: Error while retrieving note
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseError'
'500':
description: Server error, normally indicates something wrong on the app side
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseError'
/note:
post:
description: Lets a user post a new artist
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateNoteRequest'
responses:
'201':
description: Successfully created a new artist
content:
application/json:
schema:
$ref: '#/components/schemas/CreateNoteResponse'
'422':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseError'
'500':
description: Server error, normally indicates something wrong on the app side
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseError'
components:
schemas:
CreateNoteRequest:
type: object
required:
- message
- self_destruct
properties:
message:
type: string
example: It matters not what someone is born, but what they grow to be.
self_destruct:
type: integer
enum:
- 0
- 1
- 3
- 6
- 12
- 24
- 48
- 72
- 168
- 720
example: 3
destruct_after_opening:
type: boolean
example: false
CreateNoteResponse:
type: object
properties:
code:
type: integer
message:
type: string
data:
type: object
properties:
id:
type: string
format: uuid
example: 7f916723-72c8-4da5-8e1e-2432094f643a
url:
type: string
example: 'https://ncrypt.site/note/7f916723-72c8-4da5-8e1e-2432094f643a'
error:
type: array
items:
type: string
example: null
meta:
type: object
example: null
ResponseError:
type: object
properties:
code:
type: integer
example:
- 422
- 400
- 500
message:
type: string
example: unable to retrieve note
data:
type: object
example: null
error:
type: array
items:
type: string
example:
- note does not exist
meta:
type: object
example: null
RetrieveNoteResponse:
type: object
properties:
code:
type: integer
example: 200
message:
type: string
example: Message retrieved.
data:
type: object
properties:
note:
type: string
example: We are only as strong as we are united, as weak as we are divided.
error:
type: array
items:
type: string
example: null
meta:
type: object
example: null