Skip to content

Commit

Permalink
feat(spec): add /v2/characters/:id/training
Browse files Browse the repository at this point in the history
Closes #63
  • Loading branch information
TheMrMilchmann committed Mar 16, 2021
1 parent e4a5df9 commit 287a2b4
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/changelog/0.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ _Not Released Yet_
- Added support for `/v2/characters/:id/crafting`. [[GH-51](https://github.com/GW2ToolBelt/api-generator/issues/51)]
- Added support for `/v2/characters/:id/heropoints`. [[GH-56](https://github.com/GW2ToolBelt/api-generator/issues/56)]
- 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/recipes`. [[GH-59](https://github.com/GW2ToolBelt/api-generator/issues/59)]
- Added support for `/v2/characters/:id/training`. [[GH-63](https://github.com/GW2ToolBelt/api-generator/issues/63)]
16 changes: 16 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 @@ -696,6 +696,22 @@ internal val GW2v2 = GW2APIVersion {
"Recipes"(array(INTEGER), "the IDs of the character's crafting recipes")
})
}
"/Characters/:ID/Training" {
summary = "Returns information about a character's (skill-tree) training."
security = setOf(ACCOUNT, BUILDS, CHARACTERS)

pathParameter("ID", STRING, "the character's ID", camelCase = "id")
schema(record(name = "CharactersTraining", description = "Information about a character's (skill-tree) training.") {
"Training"(
description = "the training information for a character's trained skill-trees",
type = array(record(name = "Training", description = "Information about a character's trained skill-tree.") {
CamelCase("id").."ID"(INTEGER, "the skill tree's ID")
"Spent"(INTEGER, "the amount of hero points spent in the tree")
"Done"(BOOLEAN, "a flag indicating whether or not the tree is fully trained")
})
)
})
}
"/Colors" {
summary = "Returns information about all dye colors in the game."
cache = 1.hours
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"training": [
{
"id": 98,
"spent": 24,
"done": true
},
{
"id": 35,
"spent": 15,
"done": true
},
{
"id": 102,
"spent": 24,
"done": true
},
{
"id": 73,
"spent": 22,
"done": true
},
{
"id": 40,
"spent": 13,
"done": true
},
{
"id": 56,
"spent": 60,
"done": true
},
{
"id": 88,
"spent": 60,
"done": true
},
{
"id": 47,
"spent": 60,
"done": true
},
{
"id": 112,
"spent": 60,
"done": true
},
{
"id": 81,
"spent": 60,
"done": true
},
{
"id": 68,
"spent": 250,
"done": true
},
{
"id": 405,
"spent": 250,
"done": true
}
]
}
4 changes: 4 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 @@ -192,6 +192,10 @@ class GW2v2 : SpecTest(
.security(ACCOUNT, UNLOCKS)
.pathParameter("ID", STRING)

expectEndpoint("/Characters/:ID/Training")
.security(ACCOUNT, BUILDS, CHARACTERS)
.pathParameter("ID", STRING)

expectEndpoint("/Colors")
.cacheTime(1.hours)
.localized()
Expand Down

0 comments on commit 287a2b4

Please sign in to comment.