Skip to content

Commit

Permalink
feat(spec): add /v2/legendaryarmory
Browse files Browse the repository at this point in the history
Closes #178
  • Loading branch information
TheMrMilchmann committed Jul 13, 2021
1 parent 67b97fe commit f6eb3a4
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/changelog/0.5.0.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 0.5.0

_Not Released Yet_
_Not Released Yet_

#### Improvements

- Endpoints:
- Added support for `/v2/legendaryarmory`. [[GH-178](https://github.com/GW2ToolBelt/api-generator/issues/178)]
10 changes: 10 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 @@ -1641,6 +1641,16 @@ internal val GW2v2 = GW2APIVersion({ APIVersionBuilder.V2() }) {
)
})
}
"/LegendaryArmory" {
summary = "Returns information about what can be stored in the legendary armory."
cache = 1.hours

supportedQueries(BY_ID, BY_IDS, BY_PAGE)
schema(record(name = "LegendaryArmorySlot", description = "Information about an item that can be stored in the legendary armory.") {
CamelCase("id").."ID"(INTEGER, "the item's ID")
SerialName("max_count").."MaxCount"(INTEGER, "the maximum number of copies of this item that can be stored in the armory for an account")
})
}
"/Legends" {
summary = "Returns information about the Revenant legends."
cache = 1.hours
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/com/gw2tb/apigen/v2_legendaryarmory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"id": 30704,
"max_count": 2
},
{
"id": 30689,
"max_count": 2
},
{
"id": 30703,
"max_count": 2
}
]
27 changes: 27 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 @@ -1161,6 +1161,33 @@ class GW2v2 : SpecTest<APIQuery.V2, APIType.V2, GW2v2.ExpectedAPIv2Query>(
queryDetails = QueryByPage(INTEGER)
)

expectQuery(
"/LegendaryArmory",
cache = 1.hours,
queryDetails = QueryIDs(INTEGER)
)
expectQuery(
"/LegendaryArmory",
cache = 1.hours,
queryParameters = listOf(ExpectedQueryParameter("id", INTEGER)),
queryDetails = QueryByID(INTEGER)
)
expectQuery(
"/LegendaryArmory",
cache = 1.hours,
queryParameters = listOf(ExpectedQueryParameter("ids", INTEGER.array)),
queryDetails = QueryByIDs(INTEGER)
)
expectQuery(
"/LegendaryArmory",
cache = 1.hours,
queryParameters = listOf(
ExpectedQueryParameter("page", INTEGER),
ExpectedQueryParameter("page_size", INTEGER, isOptional = true)
),
queryDetails = QueryByPage(INTEGER)
)

expectQuery(
"/Legends",
cache = 1.hours,
Expand Down

0 comments on commit f6eb3a4

Please sign in to comment.