1
1
openapi : 3.0.0
2
-
3
2
info :
4
3
title : ω bbs
5
4
version : 0.0.0
6
-
7
5
servers :
8
6
- url : https://xn--omega.com/api
9
-
10
7
paths :
11
8
/posts/{post_id} :
12
9
get :
@@ -16,22 +13,150 @@ paths:
16
13
- name : post_id
17
14
in : path
18
15
required : true
19
- schema :
20
- type : string
16
+ schema : { type: string }
21
17
responses :
22
18
200 :
23
- description : " "
19
+ description : ' '
24
20
content :
25
21
application/json :
26
22
schema :
27
- $ref : " #/components/schemas/Post"
28
-
23
+ $ref : ' #/components/schemas/Post'
29
24
components :
30
25
schemas :
31
26
Post :
32
27
type : object
33
28
properties :
34
- id :
29
+ id : { type: number }
30
+ bodyType :
31
+ type : string
32
+ enum :
33
+ - text/markdown
34
+ - text/plain
35
+ body : { type: string }
36
+ authorId : { type: number }
37
+ threadId :
38
+ type : number
39
+ description : Id of the thread where the thread located
40
+ createdAt : { type: number }
41
+ updatedAt : { type: number }
42
+ deletedAt : { type: number }
43
+ required :
44
+ - bodyType
45
+ - body
46
+ - authorId
47
+ - threadId
48
+ - craetedAt
49
+ - updatedAt
50
+ Thread :
51
+ type : object
52
+ properties :
53
+ id : { type: number }
54
+ title : { type: string }
55
+ boardId : { type: number }
56
+ authorId : { type: number }
57
+ rootPostId : { type: number }
58
+ lastPostId : { type: number }
59
+ visible :
60
+ type : boolean
61
+ default : true
62
+ createdAt : { type: number }
63
+ updatedAt : { type: number }
64
+ deletedAt : { type: number }
65
+ required :
66
+ - title
67
+ - boardId
68
+ - visible
69
+ - authorId
70
+ - rootPostId
71
+ - lastPostId
72
+ - createdAt
73
+ - updatedAt
74
+ Board :
75
+ type : object
76
+ properties :
77
+ id : { type: number }
78
+ slug :
79
+ type : string
80
+ description : for url only
81
+ name : { type: string }
82
+ className :
83
+ type : string
84
+ description : for display only
85
+ description :
86
+ type : string
87
+ description : should be rendered as HTML
88
+ required :
89
+ - slug
90
+ - name
91
+ User :
92
+ type : object
93
+ properties :
94
+ id : { type: number }
95
+ username :
96
+ type : string
97
+ description : ' @ and login, unique and immutable'
98
+ displayName :
99
+ type : string
100
+ description : displays in post author, not unique
101
+ email : { type: string }
102
+ hashedPassword :
103
+ type : string
104
+ description : bcrypt
105
+ bio : { type: string }
106
+ role : { type: number }
107
+ avatar :
108
+ type : string
109
+ description : uploaded avatar will save into db as url; needs regenerate if storage driver updated
110
+ avatarId :
111
+ type : number
112
+ description : null if the avatar is not uploaded manually
113
+ lastLoggedInAt : { type: number }
114
+ createdAt : { type: number }
115
+ required :
116
+ - username
117
+ - email
118
+ - hashedPassword
119
+ - role
120
+ - createdAt
121
+ Role :
122
+ type : object
123
+ properties :
124
+ id : { type: number }
125
+ permissions :
126
+ type : array
127
+ items : { type: string }
128
+ title : { type: string }
129
+ required :
130
+ - permissions
131
+ - title
132
+ File :
133
+ type : object
134
+ properties :
135
+ id : { type: number }
136
+ postId :
137
+ type : number
138
+ description : null if this file is not associated with any post (avatar or so)
139
+ authorId : { type: number }
140
+ filename : { type: string }
141
+ mime : { type: string }
142
+ hash : { type: string }
143
+ size :
35
144
type : number
36
- title :
145
+ description : in bytes
146
+ storageDriver : { type: string }
147
+ path : { type: string }
148
+ url :
37
149
type : string
150
+ description : calculated at runtime
151
+ createdAt : { type: number }
152
+ deletedAt : { type: number }
153
+ required :
154
+ - authorId
155
+ - filename
156
+ - mime
157
+ - hash
158
+ - size
159
+ - storageDriver
160
+ - path
161
+ - url
162
+ - cratedAt
0 commit comments