Skip to content

Releases: GW2ToolBelt/GW2APIClient

0.8.0

12 Nov 15:40
3481845
Compare
Choose a tag to compare

Overview

This release was specifically crafted to address a critical bug in the Guild Wars 2 API which caused header-based authorization to fail. Thus, this release introduces a mechanism to configure how requests are authenticated:

  • AuthenticationStrategy.HEADER will remain the default authentication strategy and is recommended for most use cases.
  • AuthenticationStrategy.QUERY is a new authentication strategy that appends the API key as a query parameter to the request URL. This strategy is considered unsafe outside of server environments. Use with caution.

Improvements

  • It is now possible to configure how requests are authenticated by configuring the AuthenticationStrategy for a client.

0.7.0

30 Oct 13:33
aeeeff5
Compare
Choose a tag to compare

Improvements

  • Build Kotlin/Wasm (wasmJs) binaries for all Kotlin multiplatform modules.

Breaking Changes

  • The copy function of RequestTemplate is no longer accessible.

0.6.0

25 Oct 10:24
8cf7879
Compare
Choose a tag to compare

Fixes

  • Fixed a critical bug in the path parameter substitution logic that caused requests with path parameters to target invalid endpoints.

Breaking Changes

  • api-client-ktor now requires Ktor 3.

0.5.0

27 Jul 21:52
9f1ed05
Compare
Choose a tag to compare

Overview

This release is a long overdue major update to the project. The entire API surface has been touched up and improved to provide a better developer experience.

The most significant change is the decoupling of request creation from request execution:

// Old
suspend fun main() {
  val client = GW2APIClient(...)
  val requestBuilder = client.gw2v2Build()

  val request = coroutineScope { requestBuilder.execute(this) }
  val response = request.get()

  val gw2v2Build = response.data.getOrNull() ?: error("Could not decode request")

  println("Build ID: ${gw2v2Build.id}")
}

Whereas the old way to create requests contained a lot of ceremony to support asynchronous and synchronous execution at the same time, the new way is much more straightforward:

// New
suspend fun main() {
  val client = Gw2ApiClient()
  val gw2v2Build = client.executeAsync(gw2v2Build()).dataOrNull ?: error("Failed to fetch build ID.")

  println("Build ID: {$gw2v2Build.id}")
}

There is no full migration guide available. Please refer to the updated documentation for more information.

Improvements

  • Added an explicit Java module descriptor for api-types.
  • Added a simple API to allow blocking execution of requests on the JVM.
    • This is especially useful in combination with virtual threads.
  • Replaced placeholder exception that is thrown when an unknown type is encountered with a SerializationException.
  • Migrated to schema version 2022-03-23T19:00:00.000Z.

Breaking Changes

  • Migrated to schema version 2022-03-23T19:00:00.000Z.
  • The entire API client has been rewritten to decouple request creation from execution. Please see the updated documentation for more information.

0.4.0

27 Jul 12:46
752642e
Compare
Choose a tag to compare

Improvements

  • Updated to api-generator to 0.6.0.
  • Cleaned up caching.
    • Renamed CacheAccessor to CacheAccess.
    • Cache time overwrites were removed for now.
  • Cleaned up the RateLimiter interface and related hooks.
    • A default TokenBucketRateLimiter implementation is now available.
    • API clients are now configured to use a rate limiter by default.
  • Introduced the DecodingResult abstraction to improve error-handling
    capabilities for malformed data from the API.
  • Introduced the ResponseHeaders abstraction that wraps headers of a
    Response and provides utilities.
  • Improved documentation throughout the entire library.

Breaking Changes

  • All modules now require Kotlin 1.7
  • JVM modules now require Java 11
  • The library was significantly reworked and many things were either renamed or
    relocated. Detailed migration guidelines are not available for this release.

0.3.0

29 Jul 16:43
1748824
Compare
Choose a tag to compare

Improvements

  • Updated to api-generator to 0.4.0.
  • Result is now used to catch exceptions during deserialization.

0.2.0

25 Jan 12:08
ddaf41e
Compare
Choose a tag to compare

Improvements

0.1.0

24 Dec 13:10
201279d
Compare
Choose a tag to compare

Overview

GW2APIClient is a cross-platform client for the official Guild Wars 2 API.
By leveraging Kotlin Multiplatform,
GW2APIClient can be used on a large variety of platforms (including Android, the
JVM, and JS) and interoperates seamlessly with various popular programming
languages.

GW2APIClient provides low-level access to the data provided by Guild Wars 2's
API. It does not provide higher-level abstractions, visualizations or analytical
functionality but may be used to build such tools.