Skip to content

Commit

Permalink
feat(spec): add /v2/characters/:id/skills
Browse files Browse the repository at this point in the history
Closes #61
  • Loading branch information
TheMrMilchmann committed Apr 8, 2021
1 parent b0c1b95 commit bfeca0c
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog/0.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ _Not Released Yet_
- Added support for `/v2/characters/:id/quests`. [[GH-58](https://github.com/GW2ToolBelt/api-generator/issues/58)]
- Added support for `/v2/characters/:id/recipes`. [[GH-59](https://github.com/GW2ToolBelt/api-generator/issues/59)]
- Added support for `/v2/characters/:id/sab`. [[GH-60](https://github.com/GW2ToolBelt/api-generator/issues/60)]
- Added support for `/v2/characters/:id/skills`. [[GH-61](https://github.com/GW2ToolBelt/api-generator/issues/61)]
- Added support for `/v2/characters/:id/specializations`. [[GH-62](https://github.com/GW2ToolBelt/api-generator/issues/62)]
- Added support for `/v2/characters/:id/training`. [[GH-63](https://github.com/GW2ToolBelt/api-generator/issues/63)]
- Added support for `/v2/guild/search`. [[GH-91](https://github.com/GW2ToolBelt/api-generator/issues/91)]
Expand Down
23 changes: 23 additions & 0 deletions src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,29 @@ internal val GW2v2 = GW2APIVersion({ APIVersionBuilder.V2() }) {
)
})
}
"/Characters/:ID/Skills"(until = V2_SCHEMA_2019_12_19T00_00_00_000Z) {
summary = "Returns information about a character's equipped skills."
security = setOf(ACCOUNT, BUILDS, CHARACTERS)

pathParameter("ID", STRING, "the character's ID", camelCase = "id")
schema(record(name = "CharactersSkills", description = "Information about a character's equipped skills.") {
"Skills"(
description = "the character's equipped skills",
type = record(name = "Skills", description = "Information about a character's equipped skills.") {
val SKILLS = record(name = "Skills", description = "Information about a character's equipped skills.") {
optional.."Heal"(INTEGER, "the heal skill's ID")
"Utilities"(array(INTEGER, nullableItems = true), "the IDs of the utility skills")
optional.."Elite"(INTEGER, "the elite skill's ID")
optional.."Legends"(array(STRING, nullableItems = true), "the legend IDs")
}

CamelCase("pve").."PvE"(SKILLS, "the character's PvE skills")
CamelCase("pvp").."PvP"(SKILLS, "the character's PvP skills")
CamelCase("wvw").."WvW"(SKILLS, "the character's WvW skills")
}
)
})
}
"/Characters/:ID/Specializations"(until = V2_SCHEMA_2019_12_19T00_00_00_000Z) {
summary = "Returns information about a character's equipped specializations."
security = setOf(ACCOUNT, BUILDS, CHARACTERS)
Expand Down
31 changes: 31 additions & 0 deletions src/main/resources/com/gw2tb/apigen/v2_characters_{id}_skills.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"skills": {
"pve": {
"heal": 30305,
"utilities": [
10200,
10236,
10197
],
"elite": 29519
},
"pvp": {
"heal": 30305,
"utilities": [
10200,
10236,
10197
],
"elite": 29519
},
"wvw": {
"heal": 30305,
"utilities": [
10200,
10236,
10197
],
"elite": 29519
}
}
}
8 changes: 8 additions & 0 deletions src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,14 @@ class GW2v2 : SpecTest<APIQuery.V2, APIType.V2, GW2v2.ExpectedAPIv2Query>(
)
)

expectQuery(
"/Characters/:ID/Skills",
security = setOf(ACCOUNT, BUILDS, CHARACTERS),
pathParameters = listOf(
ExpectedPathParameter("ID", STRING)
)
)

expectQuery(
"/Characters/:ID/Specializations",
security = setOf(ACCOUNT, BUILDS, CHARACTERS),
Expand Down

0 comments on commit bfeca0c

Please sign in to comment.