diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e95d42dcd..75776e6fe 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.482.0" + ".": "0.482.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 77a706123..9e9fcd4fd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 236 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-36f56ec639c447a9374b42b2dc9e278844c838d51b88c4f128e7e46662a75a81.yml -openapi_spec_hash: 7c15b5db4bf14fd71f7220a445ae2ada +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-58c8e720561e1df665b4f5bf35a4dedba1dba3f01d20f8ef5f662d093c432f4d.yml +openapi_spec_hash: 75dfc5fb4c8d03524aa1bc5587835039 config_hash: 25d7d7aa4882db6189b4b53e8e249e80 diff --git a/CHANGELOG.md b/CHANGELOG.md index 93bb8ddc2..030604502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.482.1 (2026-03-17) + +Full Changelog: [v0.482.0...v0.482.1](https://github.com/Increase/increase-java/compare/v0.482.0...v0.482.1) + +### Bug Fixes + +* **client:** allow updating header/query affecting fields in `toBuilder()` ([3e8a5a9](https://github.com/Increase/increase-java/commit/3e8a5a97a24640f220f38cdad8f82ec047f1c523)) + ## 0.482.0 (2026-03-17) Full Changelog: [v0.481.0...v0.482.0](https://github.com/Increase/increase-java/compare/v0.481.0...v0.482.0) diff --git a/README.md b/README.md index 3f54ca386..d9e2efe86 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.482.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.482.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.482.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.482.1) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.482.1/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.482.1) @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe -The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.482.0). +The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.482.1). @@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ### Gradle ```kotlin -implementation("com.increase.api:increase-java:0.482.0") +implementation("com.increase.api:increase-java:0.482.1") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.482.0") com.increase.api increase-java - 0.482.0 + 0.482.1 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 0be2b543b..85e011739 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.482.0" // x-release-please-version + version = "0.482.1" // x-release-please-version } subprojects { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/core/ClientOptions.kt b/increase-java-core/src/main/kotlin/com/increase/api/core/ClientOptions.kt index d3b569671..a1a36135b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/core/ClientOptions.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/core/ClientOptions.kt @@ -477,13 +477,14 @@ private constructor( headers.put("X-Stainless-Runtime", "JRE") headers.put("X-Stainless-Runtime-Version", getJavaVersion()) headers.put("X-Stainless-Kotlin-Version", KotlinVersion.CURRENT.toString()) + // We replace after all the default headers to allow end-users to overwrite them. + headers.replaceAll(this.headers.build()) + queryParams.replaceAll(this.queryParams.build()) apiKey.let { if (!it.isEmpty()) { - headers.put("Authorization", "Bearer $it") + headers.replace("Authorization", "Bearer $it") } } - headers.replaceAll(this.headers.build()) - queryParams.replaceAll(this.queryParams.build()) return ClientOptions( httpClient, diff --git a/increase-java-core/src/test/kotlin/com/increase/api/core/ClientOptionsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/core/ClientOptionsTest.kt index cac5a913a..a5dc38ce2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/core/ClientOptionsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/core/ClientOptionsTest.kt @@ -16,6 +16,29 @@ internal class ClientOptionsTest { private val httpClient = mock() + @Test + fun putHeader_canOverwriteDefaultHeader() { + val clientOptions = + ClientOptions.builder() + .httpClient(httpClient) + .putHeader("User-Agent", "My User Agent") + .apiKey("My API Key") + .build() + + assertThat(clientOptions.headers.values("User-Agent")).containsExactly("My User Agent") + } + + @Test + fun toBuilder_bearerAuthCanBeUpdated() { + var clientOptions = + ClientOptions.builder().httpClient(httpClient).apiKey("My API Key").build() + + clientOptions = clientOptions.toBuilder().apiKey("another My API Key").build() + + assertThat(clientOptions.headers.values("Authorization")) + .containsExactly("Bearer another My API Key") + } + @Test fun toBuilder_whenOriginalClientOptionsGarbageCollected_doesNotCloseOriginalClient() { var clientOptions =