-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.yml
2147 lines (2147 loc) · 57.9 KB
/
api.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
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.0
info:
contact:
email: [email protected]
description: Odd Giants Public API
license:
name: MIT
url: http://www.apache.org/licenses/LICENSE-2.0.html
title: Odd Giants Public API
version: 0.0.1
components:
parameters:
achievement_id:
in: path
name: achievement_id
required: true
schema:
$ref: '#/components/schemas/achievement_id'
category_id:
in: path
name: category_id
required: true
schema:
$ref: '#/components/schemas/category_id'
giant_id:
in: path
name: giant_id
required: true
schema:
$ref: '#/components/schemas/giant_id'
inhabitant_id:
in: path
name: inhabitant_id
required: true
schema:
$ref: '#/components/schemas/inhabitant_id'
item_id:
in: path
name: item_id
required: true
schema:
$ref: '#/components/schemas/item_id'
location_id:
example: GCR105E77812AEF
in: path
name: location_id
required: true
schema:
$ref: '#/components/schemas/location_id'
region_id:
in: path
name: region_id
required: true
schema:
$ref: '#/components/schemas/region_id'
search_query:
in: query
name: q
required: true
schema:
format: uri-encoded
type: string
skill_id:
in: path
name: skill_id
required: true
schema:
$ref: '#/components/schemas/skill_id'
upgrade_id:
in: path
name: upgrade_id
required: true
schema:
$ref: '#/components/schemas/upgrade_id'
user_id:
in: path
name: user_id
required: true
schema:
$ref: '#/components/schemas/user_id'
requestBodies:
Login:
content:
application/json:
schema:
$ref: '#/components/schemas/AuthenticationCredentials'
description: Authentication credentials
responses:
Error:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: Something went wrong
GetAchievement:
content:
application/json:
schema:
$ref: '#/components/schemas/GetAchievementResponse'
description: Successfully loaded Achievement
GetAchievementsByCategory:
content:
application/json:
schema:
$ref: '#/components/schemas/GetAchievementsByCategoryResponse'
description: Successfully loaded Achievement by category
GetCategories:
content:
application/json:
schema:
$ref: '#/components/schemas/GetCategoriesResponse'
description: CategoryIndex
GetGiant:
content:
application/json:
schema:
$ref: '#/components/schemas/GiantDetails'
description: Successfully loaded Giant
GetInhabitant:
content:
application/json:
schema:
$ref: '#/components/schemas/GetInhabitantResponse'
description: Successfully loaded Inhabitant
GetInhabitantsByCategory:
content:
application/json:
schema:
$ref: '#/components/schemas/GetInhabitantsByCategoryResponse'
description: Sucessfully loaded Inhabitants by category
GetItem:
content:
application/json:
schema:
$ref: '#/components/schemas/GetItemResponse'
description: Successfully loaded Item
GetItemsByCategory:
content:
application/json:
schema:
$ref: '#/components/schemas/GetItemsByCategoryResponse'
description: Sucessfully loaded Items by category
GetMe:
content:
application/json:
schema:
$ref: '#/components/schemas/GetMeResponse'
description: Hey, it's you!
GetRegion:
content:
application/json:
schema:
$ref: '#/components/schemas/GetRegionResponse'
description: Successfully loaded Region
GetSearch:
content:
application/json:
schema:
$ref: '#/components/schemas/GetSearchResponse'
description: Successfully loaded search results
GetServerStats:
content:
application/json:
examples:
example-0001:
value:
players_count: 771
version: 0.9.3
schema:
$ref: '#/components/schemas/GetServerStatsResponse'
description: Successfully loaded server stats
GetSkill:
content:
application/json:
schema:
$ref: '#/components/schemas/GetSkillResponse'
description: Sucessfully loaded Inhabitants by category
GetSkillsByCategory:
content:
application/json:
schema:
$ref: '#/components/schemas/GetSkillsByCategoryResponse'
description: Sucessfully loaded Inhabitants by category
GetUpgrade:
content:
application/json:
schema:
$ref: '#/components/schemas/GetUpgradeResponse'
description: Sucessfully loaded Inhabitants by category
GetUpgradesByCategory:
content:
application/json:
schema:
$ref: '#/components/schemas/GetUpgradesByCategoryResponse'
description: Sucessfully loaded Inhabitants by category
GetUser:
content:
application/json:
schema:
$ref: '#/components/schemas/GetUserResponse'
description: Successfully loaded user info
GetUserAchievements:
content:
application/json:
schema:
$ref: '#/components/schemas/GetUserAchievementsResponse'
description: Sucessfully loaded the given user's achievments
GetUserSkills:
content:
application/json:
schema:
$ref: '#/components/schemas/GetUserSkillsResponse'
description: Sucessfully loaded the User's Skills
GetUserUpgrades:
content:
application/json:
schema:
$ref: '#/components/schemas/GetUserUpgradesResponse'
description: Sucessfully loaded the User's Upgrades
PostLogin:
content:
application/json:
schema:
$ref: '#/components/schemas/LoginResponse'
description: Successful authentication
PostLoginRefresh:
content:
application/json:
schema:
$ref: '#/components/schemas/LoginRefreshResponse'
description: The user has successfully refreshed their session
schemas:
Achievement:
properties:
category:
$ref: '#/components/schemas/category_id'
category_id:
$ref: '#/components/schemas/category_id'
conditions:
items:
properties:
group:
type: string
label:
nullable: true
type: string
type:
enum:
- counter
- group_sum
- group_count
type: string
value:
type: string
title: AchievementCondition
type: object
type: array
created_at:
format: date-time
type: string
description:
example: Visited 5 new locations.
type: string
id:
$ref: '#/components/schemas/achievement_id'
name:
example: Junior OK Explorer
type: string
reward:
$ref: '#/components/schemas/Reward'
reward_currants:
example: 0
type: integer
reward_energy:
example: 0
type: integer
reward_giant:
$ref: '#/components/schemas/giant_id'
reward_giant_favor:
example: 10
type: integer
reward_mood:
example: 0
type: integer
reward_xp:
example: 125
type: integer
status_text:
example: Hey! You're getting pretty good at finding your way around. You've earned a Junior OK Explorer badge.
type: string
updated_at:
format: date-time
type: string
required:
- id
- category_id
- name
- description
- status_text
- conditions
- reward_xp
- reward_currants
- reward_mood
- reward_energy
- reward_giant
- reward_giant_favor
- created_at
- updated_at
- reward
- category
type: object
AchievementAchievement:
allOf:
- $ref: '#/components/schemas/Achievement'
- $ref: '#/components/schemas/AchievementAchievementConnection'
title: AchievementAchievement
AchievementAchievementConnection:
properties:
achievement_id:
$ref: '#/components/schemas/Achievement'
connection_id:
$ref: '#/components/schemas/Achievement'
type: object
AchievementConnections:
properties:
connections_from:
items:
$ref: '#/components/schemas/AchievementAchievement'
type: array
connections_to:
items:
$ref: '#/components/schemas/AchievementAchievement'
type: array
items:
items:
$ref: '#/components/schemas/AchievementItem'
type: array
required_for_recipes:
items:
$ref: '#/components/schemas/AchievementRecipe'
type: array
required_for_upgrades:
items:
$ref: '#/components/schemas/AchievementUpgrade'
type: array
required:
- connections_from
- connections_to
- required_for_upgrades
- required_for_recipes
- items
type: object
AchievementDetails:
allOf:
- $ref: '#/components/schemas/Achievement'
- $ref: '#/components/schemas/AchievementConnections'
title: AchievementDetails
AchievementItem:
allOf:
- $ref: '#/components/schemas/Item'
- $ref: '#/components/schemas/AchievementItemConnections'
title: AchievementItem
AchievementItemConnections:
properties:
achievement_id:
$ref: '#/components/schemas/achievement_id'
item_id:
$ref: '#/components/schemas/item_id'
required:
- achievement_id
- item_id
type: object
AchievementRecipe:
allOf:
- $ref: '#/components/schemas/Recipe'
- $ref: '#/components/schemas/AchievementRecipeConnection'
title: AchievementRecipe
AchievementRecipeConnection:
properties:
pivot:
properties:
achievement_id:
$ref: '#/components/schemas/achievement_id'
recipe_id:
$ref: '#/components/schemas/Recipe'
title: AchievementRecipePivot
type: object
type: object
AchievementUpgrade:
allOf:
- $ref: '#/components/schemas/Upgrade'
- $ref: '#/components/schemas/AchievementUpgradeConnections'
title: AchievementUpgrade
AchievementUpgradeConnections:
properties:
pivot:
properties:
achievement_id:
$ref: '#/components/schemas/achievement_id'
upgrade_id:
$ref: '#/components/schemas/upgrade_id'
title: AchievementUpgradePivot
type: object
type: object
AuthenticationCredentials:
properties:
email:
example: [email protected]
format: email
type: string
password:
example: THIS_IS_A_BAD_PASSWORD
type: string
remember:
example: true
type: boolean
required:
- email
- password
type: object
Category:
description: Categories of entries in the encyclopedia
properties:
created_at:
format: date
type: string
description:
type: string
id:
$ref: '#/components/schemas/category_id'
name:
type: string
required:
- created_at
- description
- id
- name
CategoryIndex:
description: Index of the Encyclopedia
properties:
achievements:
properties:
categories:
items:
$ref: '#/components/schemas/Category'
type: array
title: CategoryAchievements
type: object
giants:
properties:
categories:
items:
$ref: '#/components/schemas/Giant'
type: array
title: GiantList
type: object
inhabitants:
properties:
categories:
items:
$ref: '#/components/schemas/Category'
type: array
title: CategoryInhabitants
type: object
items:
properties:
categories:
items:
$ref: '#/components/schemas/Category'
type: array
title: CategoryItems
type: object
locations:
properties:
categories:
items:
$ref: '#/components/schemas/Region'
type: array
title: CategoryLocations
type: object
required:
- categories
skills:
properties:
categories:
items:
$ref: '#/components/schemas/Category'
type: array
title: CategorySkills
type: object
upgrades:
properties:
categories:
items:
$ref: '#/components/schemas/Category'
type: array
title: CategoryUpgrades
type: object
required:
- achievements
- giants
- inhabitants
- items
- locations
- skills
- upgrades
ErrorResponse:
properties:
error:
example: Something went wrong
type: string
required:
- error
type: object
GetAchievementResponse:
$ref: '#/components/schemas/AchievementDetails'
GetAchievementsByCategoryResponse:
items:
$ref: '#/components/schemas/Achievement'
type: array
GetCategoriesResponse:
$ref: '#/components/schemas/CategoryIndex'
GetInhabitantResponse:
$ref: '#/components/schemas/InhabitantDetails'
GetInhabitantsByCategoryResponse:
items:
$ref: '#/components/schemas/Inhabitant'
type: array
GetItemResponse:
$ref: '#/components/schemas/ItemDetails'
GetItemsByCategoryResponse:
items:
$ref: '#/components/schemas/Item'
type: array
GetLocationResponse:
$ref: '#/components/schemas/LocationDetails'
GetMeResponse:
$ref: '#/components/schemas/User'
GetRegionResponse:
$ref: '#/components/schemas/Location'
GetSearchResponse:
$ref: '#/components/schemas/SearchResults'
GetServerStatsResponse:
$ref: '#/components/schemas/ServerStats'
GetSkillResponse:
$ref: '#/components/schemas/SkillDetails'
GetSkillsByCategoryResponse:
items:
$ref: '#/components/schemas/Skill'
type: array
GetUpgradeResponse:
items:
$ref: '#/components/schemas/UpgradeDetails'
type: array
GetUpgradesByCategoryResponse:
items:
$ref: '#/components/schemas/Upgrade'
type: array
GetUserAchievementsResponse:
items:
$ref: '#/components/schemas/UserAchievment'
type: array
GetUserResponse:
$ref: '#/components/schemas/User'
GetUserSkillsResponse:
items:
$ref: '#/components/schemas/UserSkill'
type: array
GetUserUpgradesResponse:
items:
$ref: '#/components/schemas/UserUpgrade'
type: array
Giant:
properties:
created_at:
format: date-time
type: string
description:
type: string
followers_name:
type: string
gender:
type: string
id:
$ref: '#/components/schemas/giant_id'
name:
type: string
qualities:
type: string
type:
type: string
updated_at:
format: date-time
type: string
required:
- description
- followers_name
- gender
- id
- name
- qualities
- type
- updated_at
- created_at
type: object
GiantConnections:
properties:
skills:
items:
$ref: '#/components/schemas/GiantSkill'
type: array
required:
- skills
type: object
GiantDetails:
allOf:
- $ref: '#/components/schemas/Giant'
- $ref: '#/components/schemas/GiantConnections'
title: GiantDetails
GiantSkill:
allOf:
- $ref: '#/components/schemas/Skill'
- $ref: '#/components/schemas/GiantSkillConnection'
title: GiantSkill
GiantSkillConnection:
properties:
pivot:
properties:
giant_id:
$ref: '#/components/schemas/giant_id'
primary:
enum:
- 0
- 1
type: integer
skill_id:
$ref: '#/components/schemas/skill_id'
required:
- giant_id
- skill_id
- primary
title: GiantSkillPivot
type: object
required:
- pivot
type: object
Inhabitant:
properties:
article:
type: string
category_id:
$ref: '#/components/schemas/category_id'
created_at:
format: date-time
type: string
description:
type: string
has_infopage:
example: 1
type: integer
id:
$ref: '#/components/schemas/inhabitant_id'
items:
items:
$ref: '#/components/schemas/Item'
type: array
name:
type: string
name_plural:
type: string
updated_at:
format: date-time
type: string
required:
- article
- category_id
- created_at
- description
- has_infopage
- id
# - items
- name
- name_plural
- updated_at
InhabitantConnections:
properties:
items:
items:
$ref: '#/components/schemas/InhabitantItem'
type: array
required:
- items
type: object
InhabitantDetails:
allOf:
- $ref: '#/components/schemas/Inhabitant'
- $ref: '#/components/schemas/InhabitantConnections'
title: InhabitantDetails
InhabitantItem:
allOf:
- $ref: '#/components/schemas/Item'
- $ref: '#/components/schemas/InhabitantItemConnection'
title: InhabitantItem
InhabitantItemConnection:
properties:
pivot:
properties:
inhabitant_id:
$ref: '#/components/schemas/inhabitant_id'
item_id:
$ref: '#/components/schemas/item_id'
required:
- inhabitant_id
- item_id
title: InhabitantItemPivot
type: object
required:
- pivot
type: object
Item:
properties:
adjusted_scale:
type: number
article:
enum:
- a
- the
type: string
base_cost:
example: 1
type: integer
capacity:
example: 1
type: integer
category_id:
$ref: '#/components/schemas/category_id'
created_at:
format: date-time
type: string
description:
type: string
has_info:
example: 1
type: integer
has_infopage:
example: 1
type: integer
id:
$ref: '#/components/schemas/item_id'
is_routable:
example: 1
type: integer
label:
type: string
name:
type: string
name_plural:
type: string
name_single:
type: string
parent_classes:
items:
type: string
type: array
stackmax:
example: 1
type: integer
updated_at:
format: date-time
type: string
required:
- id
- category_id
- label
- name_single
- name_plural
- article
- description
- has_info
- has_infopage
- is_routable
- adjuested_scale
- stackmax
- capacity
- base_cost
- parent_classes
- created_at
- updated_at
- name
- recipes_tool
- recipes_input
- npcs
- achievements
ItemAchievement:
allOf:
- $ref: '#/components/schemas/Achievement'
- $ref: '#/components/schemas/ItemAchievementConnection'
title: ItemAchievement
ItemAchievementConnection:
properties:
pivot:
properties:
achievement_id:
$ref: '#/components/schemas/achievement_id'
count:
type: integer
item_id:
$ref: '#/components/schemas/item_id'
required:
- achievement_id
- item_id
- count
title: ItemAchievementPivot
type: object
required:
- pivot
type: object
ItemConnections:
properties:
achievements:
items:
$ref: '#/components/schemas/ItemAchievement'
type: array
npcs:
items:
$ref: '#/components/schemas/ItemInhabitant'
type: array
recipes_input:
items:
$ref: '#/components/schemas/RecipeItem'
type: array
recipes_output:
items:
$ref: '#/components/schemas/RecipeItem'
type: array
recipes_tool:
items:
$ref: '#/components/schemas/RecipeItem'
type: array
type: object
ItemDetails:
allOf:
- $ref: '#/components/schemas/Item'
- $ref: '#/components/schemas/ItemConnections'
title: ItemDetails
ItemInhabitant:
allOf:
- $ref: '#/components/schemas/Inhabitant'
- $ref: '#/components/schemas/ItemInhabitantConnection'
title: ItemInhabitant
ItemInhabitantConnection:
properties:
pivot:
properties:
item_id:
$ref: '#/components/schemas/item_id'
npc_id:
$ref: '#/components/schemas/inhabitant_id'
required:
- item_id
- npc_id
title: ItemInhabitant
type: object
required:
- pivot
type: object
Location:
properties:
contents:
$ref: '#/components/schemas/LocationContents'
created_at:
format: date-time
type: string
id:
$ref: '#/components/schemas/location_id'
label:
description: the name of the location
type: string
region_id:
$ref: '#/components/schemas/region_id'
updated_at:
format: date-time
type: string
user_id:
$ref: '#/components/schemas/user_id'
required:
- contents
- id
- label
- region_id
- updated_id
- user_id
LocationConnection:
properties:
pivot:
properties:
connection_id:
$ref: '#/components/schemas/location_id'
location_id:
$ref: '#/components/schemas/location_id'
required:
- location_id
- connection_id
title: LocationLocationPivot
type: object
required:
- pivot
type: object
LocationConnections:
properties:
connections_from:
type: array
items:
$ref: '#/components/schemas/LocationDetails'
connections_to:
type: array
items:
$ref: '#/components/schemas/LocationDetails'
items:
items:
$ref: '#/components/schemas/LocationItem'
type: array
npcs:
items:
$ref: '#/components/schemas/LocationInhabitant'
type: array
# required:
# - items
# - npcs
# - connections_from
# - connections_to
type: object
LocationContents:
additionalProperties:
# oneOf:
# - description: Permenant resident population
# $ref: '#/components/schemas/LocationContentsTypeString'
# - description: Current resident population
# $ref: '#/components/schemas/LocationContentsTypeNumber'
type: number
type: object
LocationContentsTypeString:
type: string
pattern: ^[0-9]+$
LocationContentsTypeNumber:
type: number
LocationDetails:
allOf:
- $ref: '#/components/schemas/Location'
- $ref: '#/components/schemas/LocationConnections'
title: LocationDetails
LocationInhabitant:
allOf:
- $ref: '#/components/schemas/Inhabitant'
- $ref: '#/components/schemas/LocationInhabitantConnection'
title: LocationInhabitant
LocationInhabitantConnection:
properties:
pivot:
properties:
location_id:
$ref: '#/components/schemas/location_id'
npc_id:
$ref: '#/components/schemas/inhabitant_id'
quantity:
type: integer
required:
- location_id
- npc_id
- quantity
title: LocationInhabitantPivot
type: object
required:
- pivot
type: object
LocationItem:
allOf:
- $ref: '#/components/schemas/Item'
- $ref: '#/components/schemas/LocationItemConnection'
title: LocationItem
LocationItemConnection:
properties:
pivot:
properties:
item_id:
$ref: '#/components/schemas/item_id'
location_id:
$ref: '#/components/schemas/location_id'
quantity:
type: integer
required:
- location_id
- item_id
- quantity
title: LocationItemPivot
type: object
required:
- pivot
type: object