Changelog
0.8.0¶
Released 2024 Nov 12
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¶
Released 2024 Oct 30
Improvements¶
- Build Kotlin/Wasm (
wasmJs
) binaries for all Kotlin multiplatform modules.
Breaking Changes¶
- The
copy
function ofRequestTemplate
is no longer accessible.
0.6.0¶
Released 2024 Oct 25
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¶
Released 2024 Jul 22
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 request 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¶
Released 2022 Jul 27
Improvements¶
- Updated to api-generator to 0.6.0.
- Cleaned up caching.
- Renamed
CacheAccessor
toCacheAccess
. - Cache time overwrites were removed for now.
- Renamed
- 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.
- A default
- Introduced the
DecodingResult
abstraction to improve error-handling capabilities for malformed data from the API. - Introduced the
ResponseHeaders
abstraction that wraps headers of aResponse
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¶
Released 2021 Jul 14
Improvements¶
- Updated to api-generator to 0.4.0.
Result
is now used to catch exceptions during deserialization.
0.2.0¶
Released 2021 Jan 25
Improvements¶
- Updated to api-generator to 0.3.0.
0.1.0¶
Released 2020 Dec 24
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.