Skip to content

Commit

Permalink
feat(spec): add /v1/wvw/objective_names
Browse files Browse the repository at this point in the history
Closes #176
  • Loading branch information
TheMrMilchmann committed May 1, 2021
1 parent e0ea23f commit 3e8bc8a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 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 @@ -14,6 +14,7 @@ _Not Released Yet_
- Added support for `/v1/recipes`. [[GH-172](https://github.com/GW2ToolBelt/api-generator/issues/172)]
- Added support for `/v1/skins`. [[GH-157](https://github.com/GW2ToolBelt/api-generator/issues/157)]
- Added support for `/v1/world_names`. [[GH-173](https://github.com/GW2ToolBelt/api-generator/issues/173)]
- Added support for `/v1/wvw/objectives_names`. [[GH-176](https://github.com/GW2ToolBelt/api-generator/issues/176)]
- Added support for `/v2/characters/:id/backstory`. [[GH-47](https://github.com/GW2ToolBelt/api-generator/issues/47)]
- Added support for `/v2/characters/:id/core`. [[GH-50](https://github.com/GW2ToolBelt/api-generator/issues/50)]
- Added support for `/v2/characters/:id/crafting`. [[GH-51](https://github.com/GW2ToolBelt/api-generator/issues/51)]
Expand Down
19 changes: 15 additions & 4 deletions src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v1.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal val GW2v1 = GW2APIVersion({ APIVersionBuilder.V1() }) {
SerialName("build_id").."BuildID"(INTEGER, "the current build ID")
})
}
"/event_details"(endpoint = "EventDetails") {
"/event_details"(endpoint = "/EventDetails") {
summary = "Returns information about the events in the game."

schema(record(name = "EventDetails", description = "Information about events.") {
Expand Down Expand Up @@ -93,7 +93,7 @@ internal val GW2v1 = GW2APIVersion({ APIVersionBuilder.V1() }) {
"Items"(array(INTEGER), "the IDs of the available items")
})
}
"/map_names"(endpoint = "MapNames") {
"/map_names"(endpoint = "/MapNames") {
summary = "Returns information about maps."

schema(array(
Expand All @@ -111,7 +111,7 @@ internal val GW2v1 = GW2APIVersion({ APIVersionBuilder.V1() }) {
"Recipes"(array(INTEGER), "the IDs of the available recipes")
})
}
"/skin_details"(endpoint = "SkinDetails") {
"/skin_details"(endpoint = "/SkinDetails") {
summary = "Returns information about the skins in the game."
cache = 1.hours

Expand Down Expand Up @@ -167,7 +167,7 @@ internal val GW2v1 = GW2APIVersion({ APIVersionBuilder.V1() }) {
"Skins"(array(INTEGER), "the IDs of the available skins")
})
}
"/world_names"(endpoint = "WorldNames") {
"/world_names"(endpoint = "/WorldNames") {
summary = "Returns information about the available worlds (or servers)."

schema(array(
Expand All @@ -178,4 +178,15 @@ internal val GW2v1 = GW2APIVersion({ APIVersionBuilder.V1() }) {
}
))
}
"/wvw/objectives_names"(endpoint = "/WvW/ObjectivesNames") {
summary = "Returns information about the available WvW objectives."

schema(array(
description = "the available objectives",
items = record(name = "WorldName", description = "Information about a WvW objective.") {
CamelCase("id").."ID"(STRING, "the ID of the objective")
localized.."Name"(STRING, "the objective's localized name")
}
))
}
}
22 changes: 22 additions & 0 deletions src/main/resources/com/gw2tb/apigen/v1_wvw_objectives_names.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"id": "96-62",
"name": "Temple of Lost Prayers"
},
{
"id": "94-62",
"name": "Temple of Lost Prayers"
},
{
"id": "95-62",
"name": "Temple of the Fallen"
},
{
"id": "94-35",
"name": "Greenbriar"
},
{
"id": "96-35",
"name": "Redbriar"
}
]
5 changes: 5 additions & 0 deletions src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v1.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class GW2v1 : SpecTest<APIQuery.V1, APIType.V1, GW2v1.ExpectedAPIv1Query>(
"/world_names",
isLocalized = true
)

expectQuery(
"/wvw/objectives_names",
isLocalized = true
)
}
) {

Expand Down

0 comments on commit 3e8bc8a

Please sign in to comment.