From dce81ae15c1963dda349526931906db7fbdce945 Mon Sep 17 00:00:00 2001 From: Leon Linhart Date: Sat, 16 Jan 2021 13:15:49 +0100 Subject: [PATCH] feat(spec): add /v2/mounts/types Closes #107 --- docs/changelog/0.3.0.md | 1 + .../com/gw2tb/apigen/internal/spec/GW2v2.kt | 20 +++++++++++++++++++ .../com/gw2tb/apigen/test/spec/GW2v2.kt | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/docs/changelog/0.3.0.md b/docs/changelog/0.3.0.md index 1d45bf2f..17c3bae2 100644 --- a/docs/changelog/0.3.0.md +++ b/docs/changelog/0.3.0.md @@ -12,6 +12,7 @@ _Not Released Yet_ - Added support for `/v2/minis`. [[GH-104](https://github.com/GW2ToolBelt/api-generator/issues/104)] - Added support for `/v2/mounts`. [[GH-105](https://github.com/GW2ToolBelt/api-generator/issues/105)] - Added support for `/v2/mounts/skins`. [[GH-106](https://github.com/GW2ToolBelt/api-generator/issues/106)] + - Added support for `/v2/mounts/types`. [[GH-107](https://github.com/GW2ToolBelt/api-generator/issues/107)] - Added support for `/v2/pets`. [[GH-110](https://github.com/GW2ToolBelt/api-generator/issues/110)] - Added support for `/v2/quaggans`. [[GH-122](https://github.com/GW2ToolBelt/api-generator/issues/122)] - Added support for `/v2/raids`. [[GH-125](https://github.com/GW2ToolBelt/api-generator/issues/125)] diff --git a/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt b/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt index 144e1250..e938e4aa 100644 --- a/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt +++ b/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt @@ -1069,6 +1069,26 @@ internal val GW2v2 = GW2APIVersion { ) }) } + "/Mounts/Types" { + summary = "Returns information about mount types." + cache = 1.hours + isLocalized = true + + supportedQueries(BY_ID, BY_IDS, BY_PAGE) + schema(record(name = "MountType", description = "Information about a mount type.") { + CamelCase("id").."ID"(INTEGER, "the mount type's ID") + "Name"(STRING, "the mount type's name") + SerialName("default_skin").."DefaultSkin"(INTEGER, "the ID of the mount type's default skin") + "Skins"(array(INTEGER), "the IDs of the skins available for the mount type") + "Skills"( + description = "the mount type's skills", + type = array(record(name = "Skill", description = "Information about a mount skill.") { + CamelCase("id").."ID"(INTEGER, "the mount skill's ID") + "Slot"(INTEGER, "the mount skill's slot") + }) + ) + }) + } "/Outfits" { summary = "Returns information about outfits." cache = 1.hours diff --git a/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt b/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt index 4038750c..9263fb79 100644 --- a/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt +++ b/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt @@ -265,6 +265,11 @@ class GW2v2 : SpecTest( .localized() .queryTypes(BY_ID, BY_IDS, BY_PAGE) + expectEndpoint("/Mounts/Types") + .cacheTime(1.hours) + .localized() + .queryTypes(BY_ID, BY_IDS, BY_PAGE) + expectEndpoint("/Outfits") .cacheTime(1.hours) .localized()