Skip to content

Commit 056cacf

Browse files
Merge pull request #15 from CASParser/release-please--branches--main--changes--next
release: 0.7.0
2 parents 7019d1c + 630c63f commit 056cacf

64 files changed

Lines changed: 3099 additions & 181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.6.0"
2+
".": "0.7.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-e5c0c65637cdf3a6c4360b8193973b73a3d35ad1056ef607c3319ef03e591a55.yml
3-
openapi_spec_hash: 7515d1e5fe3130b9f5411f7aacbc8a64
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-e572d88c2af6e4d7bc4f7e119357fd3f68b1e67d612fd1d3a657d916cde0087c.yml
3+
openapi_spec_hash: a9fc7d947111bffa9184f8ca8be4a579
44
config_hash: 5509bb7a961ae2e79114b24c381606d4

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Changelog
22

3+
## 0.7.0 (2026-05-08)
4+
5+
Full Changelog: [v0.6.0...v0.7.0](https://github.com/CASParser/cas-parser-java/compare/v0.6.0...v0.7.0)
6+
7+
### Features
8+
9+
* **api:** api update ([298bc41](https://github.com/CASParser/cas-parser-java/commit/298bc41836f9daa2d97dd46cb1cff7a2f8116117))
10+
* **api:** api update ([2744bf4](https://github.com/CASParser/cas-parser-java/commit/2744bf455786d58b2ccb12e2a7e8f125586b71b1))
11+
* **client:** improve logging ([61ed692](https://github.com/CASParser/cas-parser-java/commit/61ed692db29db103fcaebcceb0704c04ecff765d))
12+
* **client:** more robust error parsing ([98e6ec7](https://github.com/CASParser/cas-parser-java/commit/98e6ec79767f1c16a0cfff5262ae29dad9600873))
13+
* **client:** support proxy authentication ([2568fbd](https://github.com/CASParser/cas-parser-java/commit/2568fbd4e09f2788cb1b7f49ce00a83505bf2370))
14+
* support setting headers via env ([ee0b90d](https://github.com/CASParser/cas-parser-java/commit/ee0b90db7cf144c61c23891ff8d026b0b6c358da))
15+
16+
17+
### Performance Improvements
18+
19+
* **client:** create one json mapper ([720bb86](https://github.com/CASParser/cas-parser-java/commit/720bb86a8c014e99d8e3a3adbd14b5b9ee4d337a))
20+
21+
22+
### Chores
23+
24+
* redact api-key headers in debug logs ([5117271](https://github.com/CASParser/cas-parser-java/commit/5117271062edec94ae5dca288fbff8469e7ab73c))
25+
* remove duplicated dokka setup ([2265192](https://github.com/CASParser/cas-parser-java/commit/226519252d2ec845c0ca05a13902c3574e0d33e2))
26+
27+
28+
### Documentation
29+
30+
* clarify forwards compat behavior ([1181b47](https://github.com/CASParser/cas-parser-java/commit/1181b475ff522b2753786939e5b36e783ab78690))
31+
332
## 0.6.0 (2026-04-19)
433

534
Full Changelog: [v0.5.4...v0.6.0](https://github.com/CASParser/cas-parser-java/compare/v0.5.4...v0.6.0)

README.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.cas_parser.api/cas-parser-java)](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.6.0)
6-
[![javadoc](https://javadoc.io/badge2/com.cas_parser.api/cas-parser-java/0.6.0/javadoc.svg)](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.6.0)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.cas_parser.api/cas-parser-java)](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.7.0)
6+
[![javadoc](https://javadoc.io/badge2/com.cas_parser.api/cas-parser-java/0.7.0/javadoc.svg)](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.7.0)
77

88
<!-- x-release-please-end -->
99

@@ -22,7 +22,7 @@ Use the Cas Parser MCP Server to enable AI assistants to interact with this API,
2222
2323
<!-- x-release-please-start-version -->
2424

25-
The REST API documentation can be found on [casparser.in](https://casparser.in/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.6.0).
25+
The REST API documentation can be found on [casparser.in](https://casparser.in/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.7.0).
2626

2727
<!-- x-release-please-end -->
2828

@@ -33,7 +33,7 @@ The REST API documentation can be found on [casparser.in](https://casparser.in/d
3333
### Gradle
3434

3535
```kotlin
36-
implementation("com.cas_parser.api:cas-parser-java:0.6.0")
36+
implementation("com.cas_parser.api:cas-parser-java:0.7.0")
3737
```
3838

3939
### Maven
@@ -42,7 +42,7 @@ implementation("com.cas_parser.api:cas-parser-java:0.6.0")
4242
<dependency>
4343
<groupId>com.cas_parser.api</groupId>
4444
<artifactId>cas-parser-java</artifactId>
45-
<version>0.6.0</version>
45+
<version>0.7.0</version>
4646
</dependency>
4747
```
4848

@@ -236,8 +236,6 @@ The SDK throws custom unchecked exception types:
236236

237237
## Logging
238238

239-
The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).
240-
241239
Enable logging by setting the `CAS_PARSER_LOG` environment variable to `info`:
242240

243241
```sh
@@ -250,6 +248,19 @@ Or to `debug` for more verbose logging:
250248
export CAS_PARSER_LOG=debug
251249
```
252250

251+
Or configure the client manually using the `logLevel` method:
252+
253+
```java
254+
import com.cas_parser.api.client.CasParserClient;
255+
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
256+
import com.cas_parser.api.core.LogLevel;
257+
258+
CasParserClient client = CasParserOkHttpClient.builder()
259+
.fromEnv()
260+
.logLevel(LogLevel.INFO)
261+
.build();
262+
```
263+
253264
## ProGuard and R8
254265

255266
Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `cas-parser-java-core` is published with a [configuration file](cas-parser-java-core/src/main/resources/META-INF/proguard/cas-parser-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).
@@ -342,6 +353,21 @@ CasParserClient client = CasParserOkHttpClient.builder()
342353
.build();
343354
```
344355

356+
If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:
357+
358+
```java
359+
import com.cas_parser.api.client.CasParserClient;
360+
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
361+
import com.cas_parser.api.core.http.ProxyAuthenticator;
362+
363+
CasParserClient client = CasParserOkHttpClient.builder()
364+
.fromEnv()
365+
.proxy(...)
366+
// Or a custom implementation of `ProxyAuthenticator`.
367+
.proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))
368+
.build();
369+
```
370+
345371
### Connection pooling
346372

347373
To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
@@ -562,7 +588,9 @@ In rare cases, the API may return a response that doesn't match the expected typ
562588

563589
By default, the SDK will not throw an exception in this case. It will throw [`CasParserInvalidDataException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/CasParserInvalidDataException.kt) only if you directly access the property.
564590

565-
If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
591+
Validating the response is _not_ forwards compatible with new types from the API for existing fields.
592+
593+
If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:
566594

567595
```java
568596
import com.cas_parser.api.models.credits.CreditCheckResponse;

build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repositories {
99

1010
allprojects {
1111
group = "com.cas_parser.api"
12-
version = "0.6.0" // x-release-please-version
12+
version = "0.7.0" // x-release-please-version
1313
}
1414

1515
subprojects {
@@ -22,7 +22,6 @@ subprojects {
2222
group = "Verification"
2323
description = "Verifies all source files are formatted."
2424
}
25-
apply(plugin = "org.jetbrains.dokka")
2625
}
2726

2827
subprojects {

cas-parser-java-client-okhttp/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ dependencies {
77
api(project(":cas-parser-java-core"))
88

99
implementation("com.squareup.okhttp3:okhttp:4.12.0")
10-
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
1110

1211
testImplementation(kotlin("test"))
1312
testImplementation("org.assertj:assertj-core:3.27.7")

cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ package com.cas_parser.api.client.okhttp
55
import com.cas_parser.api.client.CasParserClient
66
import com.cas_parser.api.client.CasParserClientImpl
77
import com.cas_parser.api.core.ClientOptions
8+
import com.cas_parser.api.core.LogLevel
89
import com.cas_parser.api.core.Sleeper
910
import com.cas_parser.api.core.Timeout
1011
import com.cas_parser.api.core.http.Headers
1112
import com.cas_parser.api.core.http.HttpClient
13+
import com.cas_parser.api.core.http.ProxyAuthenticator
1214
import com.cas_parser.api.core.http.QueryParams
1315
import com.cas_parser.api.core.jsonMapper
1416
import com.fasterxml.jackson.databind.json.JsonMapper
@@ -47,6 +49,7 @@ class CasParserOkHttpClient private constructor() {
4749
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
4850
private var dispatcherExecutorService: ExecutorService? = null
4951
private var proxy: Proxy? = null
52+
private var proxyAuthenticator: ProxyAuthenticator? = null
5053
private var maxIdleConnections: Int? = null
5154
private var keepAliveDuration: Duration? = null
5255
private var sslSocketFactory: SSLSocketFactory? = null
@@ -77,6 +80,20 @@ class CasParserOkHttpClient private constructor() {
7780
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
7881
fun proxy(proxy: Optional<Proxy>) = proxy(proxy.getOrNull())
7982

83+
/**
84+
* Provides credentials when an HTTP proxy responds with `407 Proxy Authentication
85+
* Required`.
86+
*/
87+
fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
88+
this.proxyAuthenticator = proxyAuthenticator
89+
}
90+
91+
/**
92+
* Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`.
93+
*/
94+
fun proxyAuthenticator(proxyAuthenticator: Optional<ProxyAuthenticator>) =
95+
proxyAuthenticator(proxyAuthenticator.getOrNull())
96+
8097
/**
8198
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
8299
*
@@ -217,6 +234,9 @@ class CasParserOkHttpClient private constructor() {
217234
/**
218235
* Whether to call `validate` on every response before returning it.
219236
*
237+
* Setting this to `true` is _not_ forwards compatible with new types from the API for
238+
* existing fields.
239+
*
220240
* Defaults to false, which means the shape of the response will not be validated upfront.
221241
* Instead, validation will only occur for the parts of the response that are accessed.
222242
*/
@@ -258,6 +278,15 @@ class CasParserOkHttpClient private constructor() {
258278
*/
259279
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }
260280

281+
/**
282+
* The level at which to log request and response information.
283+
*
284+
* [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
285+
*
286+
* Defaults to [LogLevel.fromEnv].
287+
*/
288+
fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) }
289+
261290
/** Your API key for authentication. Use `sandbox-with-json-responses` as Sandbox key. */
262291
fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }
263292

@@ -360,6 +389,7 @@ class CasParserOkHttpClient private constructor() {
360389
OkHttpClient.builder()
361390
.timeout(clientOptions.timeout())
362391
.proxy(proxy)
392+
.proxyAuthenticator(proxyAuthenticator)
363393
.maxIdleConnections(maxIdleConnections)
364394
.keepAliveDuration(keepAliveDuration)
365395
.dispatcherExecutorService(dispatcherExecutorService)

cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ package com.cas_parser.api.client.okhttp
55
import com.cas_parser.api.client.CasParserClientAsync
66
import com.cas_parser.api.client.CasParserClientAsyncImpl
77
import com.cas_parser.api.core.ClientOptions
8+
import com.cas_parser.api.core.LogLevel
89
import com.cas_parser.api.core.Sleeper
910
import com.cas_parser.api.core.Timeout
1011
import com.cas_parser.api.core.http.Headers
1112
import com.cas_parser.api.core.http.HttpClient
13+
import com.cas_parser.api.core.http.ProxyAuthenticator
1214
import com.cas_parser.api.core.http.QueryParams
1315
import com.cas_parser.api.core.jsonMapper
1416
import com.fasterxml.jackson.databind.json.JsonMapper
@@ -47,6 +49,7 @@ class CasParserOkHttpClientAsync private constructor() {
4749
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
4850
private var dispatcherExecutorService: ExecutorService? = null
4951
private var proxy: Proxy? = null
52+
private var proxyAuthenticator: ProxyAuthenticator? = null
5053
private var maxIdleConnections: Int? = null
5154
private var keepAliveDuration: Duration? = null
5255
private var sslSocketFactory: SSLSocketFactory? = null
@@ -77,6 +80,20 @@ class CasParserOkHttpClientAsync private constructor() {
7780
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
7881
fun proxy(proxy: Optional<Proxy>) = proxy(proxy.getOrNull())
7982

83+
/**
84+
* Provides credentials when an HTTP proxy responds with `407 Proxy Authentication
85+
* Required`.
86+
*/
87+
fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
88+
this.proxyAuthenticator = proxyAuthenticator
89+
}
90+
91+
/**
92+
* Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`.
93+
*/
94+
fun proxyAuthenticator(proxyAuthenticator: Optional<ProxyAuthenticator>) =
95+
proxyAuthenticator(proxyAuthenticator.getOrNull())
96+
8097
/**
8198
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
8299
*
@@ -217,6 +234,9 @@ class CasParserOkHttpClientAsync private constructor() {
217234
/**
218235
* Whether to call `validate` on every response before returning it.
219236
*
237+
* Setting this to `true` is _not_ forwards compatible with new types from the API for
238+
* existing fields.
239+
*
220240
* Defaults to false, which means the shape of the response will not be validated upfront.
221241
* Instead, validation will only occur for the parts of the response that are accessed.
222242
*/
@@ -258,6 +278,15 @@ class CasParserOkHttpClientAsync private constructor() {
258278
*/
259279
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }
260280

281+
/**
282+
* The level at which to log request and response information.
283+
*
284+
* [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
285+
*
286+
* Defaults to [LogLevel.fromEnv].
287+
*/
288+
fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) }
289+
261290
/** Your API key for authentication. Use `sandbox-with-json-responses` as Sandbox key. */
262291
fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }
263292

@@ -360,6 +389,7 @@ class CasParserOkHttpClientAsync private constructor() {
360389
OkHttpClient.builder()
361390
.timeout(clientOptions.timeout())
362391
.proxy(proxy)
392+
.proxyAuthenticator(proxyAuthenticator)
363393
.maxIdleConnections(maxIdleConnections)
364394
.keepAliveDuration(keepAliveDuration)
365395
.dispatcherExecutorService(dispatcherExecutorService)

0 commit comments

Comments
 (0)