Skip to content

Commit 1367470

Browse files
authored
Some more fixes (#3)
* fix: added staffNotes to schema * feat: extracted schemas * fix: just use string Yes technically integer is also a type you can set, but code generators really don't like that. * feat: regenerated spec
1 parent 7dc3d47 commit 1367470

10 files changed

Lines changed: 197 additions & 136 deletions

File tree

api/api.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ components:
4040
ip_addr:
4141
$ref: "./components/parameters/ipAddr.yaml"
4242
schemas:
43+
AccessDeniedResponse:
44+
$ref: "./components/schemas/accessDenied.yaml"
45+
NotFoundResponse:
46+
$ref: "./components/schemas/notFound.yaml"
47+
WarningRecordType:
48+
$ref: "./components/schemas/warningRecord.yaml"
4349
ModActionActions:
4450
$ref: "./components/schemas/modActionActions.yaml"
4551
PostEventActions:
@@ -142,6 +148,8 @@ components:
142148
$ref: "./components/schemas/postVersion.yaml"
143149
RelatedTag:
144150
$ref: "./components/schemas/relatedTag.yaml"
151+
StaffNote:
152+
$ref: ./components/schemas/staffNote.yaml
145153
Tag:
146154
$ref: "./components/schemas/tag.yaml"
147155
TagAlias:

api/components/parameters/idOrName.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ name: idOrName
22
in: path
33
required: true
44
schema:
5-
oneOf:
6-
- type: integer
7-
- type: string
5+
type: string
86
description: An ID that can be either an integer or a name.
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
content:
22
application/json:
33
schema:
4-
type: object
5-
required:
6-
- record_type
7-
properties:
8-
record_type:
9-
type: string
10-
enum:
11-
- unmark
12-
- ban
13-
- record
14-
- warning
4+
$ref: "../schemas/warningRecord.yaml"

api/components/responses/accessDenied.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,4 @@ description: Access Denied
22
content:
33
application/json:
44
schema:
5-
type: object
6-
required:
7-
- success
8-
- reason
9-
properties:
10-
success:
11-
type: boolean
12-
reason:
13-
type: string
14-
enum:
15-
- "Access Denied"
5+
$ref: "../schemas/accessDenied.yaml"

api/components/responses/notFound.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,4 @@ description: Not Found
22
content:
33
application/json:
44
schema:
5-
type: object
6-
required:
7-
- success
8-
- reason
9-
properties:
10-
success:
11-
type: boolean
12-
reason:
13-
type: string
14-
enum:
15-
- "not found"
5+
$ref: "../schemas/notFound.yaml"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
type: object
2+
required:
3+
- success
4+
- reason
5+
properties:
6+
success:
7+
type: boolean
8+
reason:
9+
type: string
10+
enum:
11+
- "Access Denied"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
type: object
2+
required:
3+
- success
4+
- reason
5+
properties:
6+
success:
7+
type: boolean
8+
reason:
9+
type: string
10+
enum:
11+
- "not found"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
type: object
2+
required:
3+
- record_type
4+
properties:
5+
record_type:
6+
type: string
7+
enum:
8+
- unmark
9+
- ban
10+
- record
11+
- warning

openapi.dereferenced.yaml

Lines changed: 76 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ components:
3535
in: path
3636
required: true
3737
schema:
38-
oneOf:
39-
- type: integer
40-
- type: string
38+
type: string
4139
description: An ID that can be either an integer or a name.
4240
limit:
4341
name: limit
@@ -62,6 +60,42 @@ components:
6260
schema:
6361
type: string
6462
schemas:
63+
AccessDeniedResponse:
64+
type: object
65+
required:
66+
- success
67+
- reason
68+
properties:
69+
success:
70+
type: boolean
71+
reason:
72+
type: string
73+
enum:
74+
- Access Denied
75+
NotFoundResponse:
76+
type: object
77+
required:
78+
- success
79+
- reason
80+
properties:
81+
success:
82+
type: boolean
83+
reason:
84+
type: string
85+
enum:
86+
- not found
87+
WarningRecordType:
88+
type: object
89+
required:
90+
- record_type
91+
properties:
92+
record_type:
93+
type: string
94+
enum:
95+
- unmark
96+
- ban
97+
- record
98+
- warning
6599
ModActionActions:
66100
type: string
67101
enum:
@@ -3082,6 +3116,36 @@ components:
30823116
- 6
30833117
- 7
30843118
- 8
3119+
StaffNote:
3120+
type: object
3121+
required:
3122+
- id
3123+
- created_at
3124+
- updated_at
3125+
- user_id
3126+
- creator_id
3127+
- body
3128+
- is_deleted
3129+
- updater_id
3130+
properties:
3131+
id:
3132+
type: integer
3133+
created_at:
3134+
type: string
3135+
format: date-time
3136+
updated_at:
3137+
type: string
3138+
format: date-time
3139+
user_id:
3140+
type: integer
3141+
creator_id:
3142+
type: integer
3143+
body:
3144+
type: string
3145+
is_deleted:
3146+
type: boolean
3147+
updater_id:
3148+
type: integer
30853149
Tag:
30863150
type: object
30873151
required:
@@ -4500,9 +4564,7 @@ paths:
45004564
in: path
45014565
required: true
45024566
schema:
4503-
oneOf:
4504-
- type: integer
4505-
- type: string
4567+
type: string
45064568
description: An ID that can be either an integer or a name.
45074569
responses:
45084570
'200':
@@ -4635,9 +4697,7 @@ paths:
46354697
in: path
46364698
required: true
46374699
schema:
4638-
oneOf:
4639-
- type: integer
4640-
- type: string
4700+
type: string
46414701
description: An ID that can be either an integer or a name.
46424702
requestBody:
46434703
content:
@@ -4733,9 +4793,7 @@ paths:
47334793
in: path
47344794
required: true
47354795
schema:
4736-
oneOf:
4737-
- type: integer
4738-
- type: string
4796+
type: string
47394797
description: An ID that can be either an integer or a name.
47404798
responses:
47414799
'204':
@@ -4787,9 +4845,7 @@ paths:
47874845
in: path
47884846
required: true
47894847
schema:
4790-
oneOf:
4791-
- type: integer
4792-
- type: string
4848+
type: string
47934849
description: An ID that can be either an integer or a name.
47944850
- name: version_id
47954851
in: query
@@ -5392,9 +5448,7 @@ paths:
53925448
in: path
53935449
required: true
53945450
schema:
5395-
oneOf:
5396-
- type: integer
5397-
- type: string
5451+
type: string
53985452
description: An ID that can be either an integer or a name.
53995453
responses:
54005454
'200':
@@ -5463,9 +5517,7 @@ paths:
54635517
in: path
54645518
required: true
54655519
schema:
5466-
oneOf:
5467-
- type: integer
5468-
- type: string
5520+
type: string
54695521
description: An ID that can be either an integer or a name.
54705522
requestBody:
54715523
content:
@@ -5591,9 +5643,7 @@ paths:
55915643
in: path
55925644
required: true
55935645
schema:
5594-
oneOf:
5595-
- type: integer
5596-
- type: string
5646+
type: string
55975647
description: An ID that can be either an integer or a name.
55985648
responses:
55995649
'204':
@@ -5644,9 +5694,7 @@ paths:
56445694
in: path
56455695
required: true
56465696
schema:
5647-
oneOf:
5648-
- type: integer
5649-
- type: string
5697+
type: string
56505698
description: An ID that can be either an integer or a name.
56515699
responses:
56525700
'204':
@@ -5697,9 +5745,7 @@ paths:
56975745
in: path
56985746
required: true
56995747
schema:
5700-
oneOf:
5701-
- type: integer
5702-
- type: string
5748+
type: string
57035749
description: An ID that can be either an integer or a name.
57045750
responses:
57055751
'204':

0 commit comments

Comments
 (0)