Skip to content

Commit

Permalink
feat(spec): add /v2/characters/:id/crafting
Browse files Browse the repository at this point in the history
Closes #51
  • Loading branch information
TheMrMilchmann committed Mar 16, 2021
1 parent 6e16058 commit e73ac45
Show file tree
Hide file tree
Showing 4 changed files with 46 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 @@ -5,5 +5,6 @@ _Not Released Yet_
#### Improvements

- Endpoints:
- 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)]
17 changes: 17 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 @@ -586,6 +586,23 @@ internal val GW2v2 = GW2APIVersion {
// "Guild"(STRING, "")
// })
// }
"/Characters/:ID/Crafting" {
summary = "Returns information about a character's crafting disciplines."
security = setOf(ACCOUNT, CHARACTERS)

pathParameter("ID", STRING, "the character's ID", camelCase = "id")
schema(record(name = "CharactersCrafting", description = "Information about a character's crafting disciplines.") {
"Crafting"(
description = "the character's crafting disciplines",
type = array(record(name = "Discipline", description = "Information about a character's crafting discipline.") {
"Discipline"(STRING, "the name of the discipline")
"Rating"(INTEGER, "the character's crafting level for the discipline")
"Active"(BOOLEAN, "a flag indicating whether or not the discipline is currently active on the character")
})
)

})
}
"/Characters/:ID/HeroPoints" {
summary = "Returns information about a character's unlock hero points."
security = setOf(ACCOUNT, CHARACTERS, PROGRESSION)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"crafting": [
{
"discipline": "Artificer",
"rating": 500,
"active": true
},
{
"discipline": "Tailor",
"rating": 500,
"active": true
},
{
"discipline": "Armorsmith",
"rating": 425,
"active": false
},
{
"discipline": "Jeweler",
"rating": 400,
"active": false
}
]
}
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 @@ -164,6 +164,10 @@ class GW2v2 : SpecTest(

expectEndpoint("/Build")

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

expectEndpoint("/Characters/:ID/HeroPoints")
.security(ACCOUNT, CHARACTERS, PROGRESSION)
.pathParameter("ID", STRING)
Expand Down

0 comments on commit e73ac45

Please sign in to comment.