generated from MechanicalFlower/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
1014 lines (922 loc) · 27.1 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: "3.0.2"
info:
title: Godot Asset Library
description: Godot Engine's asset library
version: "1.0.0"
termsOfService: https://github.com/godotengine/.github/blob/master/CODE_OF_CONDUCT.md
contact:
name: Contact the author
url: https://github.com/fenix-hub
license:
name: MIT License
url: https://github.com/godotengine/godot-asset-library/blob/master/LICENSE.txt
externalDocs:
description: Markdown version
url: https://github.com/fenix-hub/godot-asset-library/blob/swagger/API.md
servers:
- url: "https://godotengine.org/asset-library/api"
tags:
- name: assets
description: Assets API
- name: assetsEdit
description: Assets Edit API
- name: configure
description: Configuration API
- name: auth
description: Authentication API
paths:
/register:
post:
tags: [auth]
summary: Register a user
description: Register a user, given a username, password, and email.
requestBody:
description: Username, Password and Email to register
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserDetails'
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/RegisterSuccessfulResult"
/login:
post:
tags: [auth]
summary: Login as a given user
description: Login as a given user. Results in a token which can be used for authenticated requests.
requestBody:
description: Username and Passaword to login with
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UsernamePassword'
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/LoginSuccessfulResult"
'403':
description: Forbidden
content:
"application/json":
schema:
$ref: "#/components/schemas/LoginForbiddenResult"
'404':
description: Not found
content:
"application/json":
schema:
$ref: "#/components/schemas/LoginNotFoundResult"
/logout:
post:
tags: [auth]
summary: Logout a user
description: Logout a user, given a token. The token is invalidated in the process.
requestBody:
description: Username and Passaword to login with
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AuthToken"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/LogoutSuccessfulResult"
/change_password:
post:
tags: [auth]
summary: Change a user's password
description: Change a user's password. The token is invalidated in the process.
requestBody:
description: Old and New password. The authentication token is mandatory.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ChangePassword'
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/ChangePwdSuccessfulResult"
/asset:
get:
tags: [assets]
summary: List assets
description: Return a paginated list of assets.
parameters:
- $ref: "#/components/parameters/typeParam"
- $ref: "#/components/parameters/categoryParam"
- $ref: "#/components/parameters/supportParam"
- $ref: "#/components/parameters/filterParam"
- $ref: "#/components/parameters/userParam"
- $ref: "#/components/parameters/godotVersionParam"
- $ref: "#/components/parameters/maxResultsParam"
- $ref: "#/components/parameters/pageParam"
- $ref: "#/components/parameters/offsetParam"
- $ref: "#/components/parameters/sortParam"
- $ref: "#/components/parameters/reverseParam"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/PaginatedAssetList"
examples:
PaginatedAssetListExample1:
$ref: "#/components/examples/PaginatedAssetListExample"
post:
tags: [assetsEdit]
summary: Update information about an asset
description: Update information about a single asset.
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AuthToken"
- $ref: "#/components/schemas/AssetDetails"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
type: object
properties:
id:
description: The id of the updated asset
type: string
/asset/{id}:
get:
tags: [assets]
summary: Get information about an asset
description: Get information about a single asset.
parameters:
- name: id
in: path
required: true
description: The asset's unique identifier.
schema:
type: string
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/AssetDetails"
examples:
AssedDetailsExample1:
$ref: "#/components/examples/AssetDetailsExample"
'404':
description: Asset not found
content:
"application/json":
schema:
$ref: "#/components/schemas/AssetNotFound"
'422':
description: Invalid request body
content:
"application/json":
schema:
$ref: "#/components/schemas/ValidationError"
post:
tags: [assetsEdit]
summary: Update information about an asset
description: Update information about a single asset.
parameters:
- name: id
in: path
required: true
description: The asset's unique identifier.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AuthToken"
- $ref: "#/components/schemas/AssetDetails"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
type: object
properties:
id:
description: The id of the updated asset
type: string
/asset/{id}/delete:
post:
tags: [assets]
summary: Soft-delete an asset
description: Soft-delete an asset. Usable by moderators and the owner of the asset.
parameters:
- name: id
in: path
required: true
description: The asset's unique identifier.
schema:
type: string
requestBody:
description: The token for the authenticated user
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AuthToken"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/SuccessfulAssetOperation"
/asset/{id}/support_level:
post:
tags: [assets]
summary: Change the support level of an asset
description: API used by moderators to change the support level of an asset.
parameters:
- name: id
in: path
required: true
description: The asset's unique identifier.
schema:
type: string
requestBody:
description: The token for the authenticated user
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AuthToken"
- type: object
properties:
token:
type: string
support_level:
type: string
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/SuccessfulAssetOperation"
/asset/edit/{id}:
get:
tags: [assetsEdit]
summary: Returns a previously-submitted asset edit
description: Returns a previously-submitted asset edit. All fields with null are unchanged, and will stay the same as in the original. The previews array is merged from the new and original previews.
parameters:
- name: id
in: path
required: true
description: The edit's unique identifier.
schema:
type: string
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/EditDetails"
post:
tags: [assetsEdit]
summary: Update information about an asset
description: Update information about a single asset.
parameters:
- name: id
in: path
required: true
description: The asset's unique identifier.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AssetDetails"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
type: object
properties:
id:
description: The id of the updated asset
type: string
/asset/edit/{id}/review:
post:
tags: [assetsEdit]
summary: Put an edit in review
description: Moderator-only. Put an edit in review. It is impossible to change it after this.
parameters:
- name: id
in: path
required: true
description: The edit's unique identifier.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AuthToken"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/EditSummary"
/asset/edit/{id}/accept:
post:
tags: [assetsEdit]
summary: Apply an edit previously put in review
description: Moderator-only. Apply an edit previously put in review.
parameters:
- name: id
in: path
required: true
description: The edit's unique identifier.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AuthToken"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/EditSummary"
/asset/edit/{id}/reject:
post:
tags: [assetsEdit]
summary: Reject an edit previously put in review
description: Moderator-only. Reject an edit previously put in review.
parameters:
- name: id
in: path
required: true
description: The edit's unique identifier.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AuthToken"
- type: object
properties:
reason:
description: The reason why the edit was rejected
type: string
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/EditSummary"
/configure:
get:
tags: [configure]
summary: Fetch categories
description: Returns category names and IDs (used for editor integration).
parameters:
- $ref: "#/components/parameters/typeParam"
- $ref: "#/components/parameters/sessionParam"
responses:
'200':
description: Successful operation
content:
"application/json":
schema:
$ref: "#/components/schemas/Category"
'422':
description: Invalid request body
content:
"application/json":
schema:
$ref: "#/components/schemas/ValidationError"
components:
parameters:
typeParam:
in: query
name: type
required: false
schema:
type: string
default: any
enum:
- any
- addon
- project
categoryParam:
in: query
name: category
required: false
schema:
type: string
supportParam:
in: query
name: support
required: false
schema:
type: string
enum:
- official
- community
- testing
filterParam:
in: query
name: filter
required: false
schema:
type: string
userParam:
in: query
name: user
required: false
schema:
type: string
godotVersionParam:
in: query
name: godot_version
required: false
schema:
type: string
pattern: '^\d{1}.\d{1}.\d{1}$'
maxResultsParam:
in: query
name: max_results
required: false
schema:
type: string
minimum: 1
maximum: 500
pageParam:
in: query
name: page
required: false
schema:
type: string
offsetParam:
in: query
name: offset
required: false
schema:
type: string
sortParam:
in: query
name: sort
required: false
schema:
type: string
enum:
- rating
- cost
- name
- updated
reverseParam:
in: query
name: reverse
required: false
schema:
type: boolean
sessionParam:
in: query
name: session
required: false
schema:
type: boolean
schemas:
AuthToken:
type: object
properties:
token:
type: string
required:
- token
RegisterSuccessfulResult:
type: object
properties:
registered:
type: boolean
username:
type: string
LoginSuccessfulResult:
type: object
properties:
authenticated:
type: boolean
username:
type: string
token:
type: string
url:
type: string
LogoutSuccessfulResult:
type: object
properties:
authenticated:
type: boolean
token:
type: string
ChangePwdSuccessfulResult:
type: object
properties:
token:
type: string
LoginForbiddenResult:
allOf:
- $ref: "#/components/schemas/Error"
- type: object
properties:
authenticated:
type: boolean
LoginNotFoundResult:
allOf:
- $ref: "#/components/schemas/Error"
UsernamePassword:
type: object
properties:
username:
type: string
password:
type: string
UserDetails:
allOf:
- $ref: "#/components/schemas/UsernamePassword"
- type: object
properties:
email:
type: string
ChangePassword:
type: object
properties:
token:
type: string
old_password:
type: string
new_password:
type: string
SuccessfulAssetOperation:
type: object
properties:
changed:
type: boolean
EditSummary:
type: object
properties:
edit_id:
type: string
status:
type: string
reason:
type: string
warning:
type: string
EditDetails:
allOf:
- $ref: "#/components/schemas/EditSummary"
- $ref: "#/components/schemas/AssetSummary"
- type: object
properties:
original:
$ref: "#/components/schemas/AssetDetails"
AssetSummary:
type: object
description: |
A resource provided by the asset library (add-on, project, ...).
These properties are returned both when requesting a list of assets or a specific asset.
properties:
token:
type: string
description: The Token obtained through a login.
asset_id:
type: string
description: The asset's unique identifier.
type:
type: string
description: The asset's type, can be "addon" or "project".
author:
type: string
description: The author's username.
author_id:
type: string
description: The author's unique identifier.
category:
type: string
description: The category the asset belongs to.
category_id:
type: string
description: The unique identifier of the category the asset belongs to.
download_provider:
type: string
enum: [Custom, GitHub, GitLab, BitBucket, Gogs/Gitea, cgit]
description: The download provider where the plugin source is hosted.
download_commit:
type: string
download_hash:
type: string
default: ''
description: >
The asset's SHA-256 hash for the latest version.
**Note:** This is currently always an empty string as asset versions' hashes aren't computed and stored yet.
cost:
type: string
description: >
The asset's license as a [SPDX license identifier](https://spdx.org/licenses/).
For compatibility reasons, this field is called `cost` instead of `license`.
godot_version:
type: string
description: >
The Godot version the asset's latest version is intended for (in `major.minor` format).<br>
This field is present for compatibility reasons with the Godot editor.
See also the `versions` array.
icon_url:
type: string
format: url
description: The asset's icon URL (should always be a PNG image).
is_archived:
type: boolean
description: >
If `true`, the asset is marked as archived by its author.
When archived, it can't receive any further reviews but can still be
unarchived at any time by the author.
issues_url:
type: string
format: url
description: >
The asset's issue reporting URL (typically associated with
the Git repository specified in `browse_url`).
modify_date:
type: string
format: date-time
description: >
The date on which the asset entry was last updated.
Note that entries can be edited independently of new asset versions being released.
rating:
type: string
description: >
The asset's rating (unused). For compatibility reasons, a value of 0 is always returned.
You most likely want `score` instead.
support_level:
type: string
enum: [official, community, testing]
description: The asset's support level.
title:
type: string
description: The asset's title (usually less than 50 characters).
version:
type: string
description: >
The asset revision string (starting from 1).<br>
Every time the asset is edited (for anyone and for any reason),
this string is incremented by 1.
version_string:
type: string
description: >
The version string of the latest version (free-form, but usually `major.minor`
or `major.minor.patch`).<br>
This field is present for compatibility reasons with the Godot editor.
See also the `versions` array.
searchable:
type: string
previews:
type: array
items:
$ref: "#/components/schemas/AssetPreview"
PaginatedAssetList:
description: A paginated list of assets.
allOf:
- $ref: "#/components/schemas/PaginationResult"
- type: object
properties:
result:
type: array
items: { $ref: "#/components/schemas/AssetSummary" }
AssetPreview:
description: |
ABCD.
type: object
properties:
preview_id:
type: string
type:
type: string
link:
type: string
format: url
thumbnail:
type: string
format: url
AssetDetails:
description: |
A resource provided by the asset library (add-on, project, ...).<br>
These properties are only returned when requesting a specific asset,
not a list of assets.
allOf:
- $ref: "#/components/schemas/AssetSummary"
- type: object
properties:
browse_url:
type: string
format: url
description: The asset's browsable repository URL.
description:
type: string
description: The asset's full description.
download_url:
type: string
format: url
description: >
The download link of the asset's latest version (should always point to a ZIP archive).<br>
This field is present for compatibility reasons with the Godot editor.
See also the `versions` array.
AssetVersion:
type: object
description: An asset version.
properties:
created_at:
type: string
format: date-time
description: The version's release date.
download_url:
type: string
format: url
description: >
The version's custom download URL (if any). Will be an empty string
if not set.
godot_version:
type: string
description: >
The minor Godot version the asset version was declared to be
compatible with (in `major.minor` format).
version_string:
type: string
description: The version identifier.
Category:
type: object
description: >
A category in which assets belong to. An asset can only belong to
one category at a time.
properties:
id:
type: string
description: The category's unique identifier.
name:
type: string
description: The category's name.
type:
type: string
description: The category's type (0 = Add-ons, 1 = Projects).
PaginationResult:
type: object
description: Properties which describe the results of the pagination requested.
properties:
page:
type: integer
description: The requested page string.
page_length:
type: integer
description: >
The requested page length.<br>
**Note:** This can be higher than the total amount of items returned.
pages:
type: integer
description: >
The total string of pages available.<br>
**Note:** If requesting a page higher than this value, a successful
response will be returned (status code 200) but no items will be listed.
total_items:
type: integer
description: The total string of items available.
AssetNotFound:
allOf:
- $ref: "#/components/schemas/Error"
Error:
type: object
description: The requested resource was not found.
properties:
error:
type: string
description: A generic error message.
TraceError:
type: object
properties:
file:
type: string
line:
type: string
function:
type: string
class:
type: string
type:
type: string
ValidationError:
type: object
description: An error returned by Laravel.
properties:
errors:
type: array
items:
type: string
description: Messages describing why the validation of the field failed.
message:
type: string
description: A generic error message.
examples:
AssetDetailsExample:
value:
asset_id: '1'
type: addon
title: Snake
author: test
author_id: '1'
version: '1'
version_string: alpha
category: 2D Tools
category_id: '1'
godot_version: '2.1'
rating: '0'
cost: GPLv3
description: Lorem ipsum…
support_level: testing
download_provider: GitHub
download_commit: master
download_hash: "(sha256 hash of the downloaded zip)"
browse_url: https://github.com/…
issues_url: https://github.com/…/issues
icon_url: https://….png
searchable: '1'
modify_date: '2018-08-21 15:49:00'
download_url: https://github.com/…/archive/master.zip
previews:
- preview_id: '1'
type: video
link: https://www.youtube.com/watch?v=…
thumbnail: https://img.youtube.com/vi/…/default.jpg
- preview_id: '2'
type: image
link: https://….png
thumbnail: https://….png
PaginatedAssetListExample:
value:
result:
- asset_id: '1'
title: Snake
author: test
author_id: '1'