Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.6.0"
".": "0.7.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-e5c0c65637cdf3a6c4360b8193973b73a3d35ad1056ef607c3319ef03e591a55.yml
openapi_spec_hash: 7515d1e5fe3130b9f5411f7aacbc8a64
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-e572d88c2af6e4d7bc4f7e119357fd3f68b1e67d612fd1d3a657d916cde0087c.yml
openapi_spec_hash: a9fc7d947111bffa9184f8ca8be4a579
config_hash: 5509bb7a961ae2e79114b24c381606d4
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.7.0 (2026-05-07)

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

### Features

* **api:** api update ([298bc41](https://github.com/CASParser/cas-parser-java/commit/298bc41836f9daa2d97dd46cb1cff7a2f8116117))
* **api:** api update ([2744bf4](https://github.com/CASParser/cas-parser-java/commit/2744bf455786d58b2ccb12e2a7e8f125586b71b1))
* **client:** improve logging ([61ed692](https://github.com/CASParser/cas-parser-java/commit/61ed692db29db103fcaebcceb0704c04ecff765d))
* **client:** more robust error parsing ([98e6ec7](https://github.com/CASParser/cas-parser-java/commit/98e6ec79767f1c16a0cfff5262ae29dad9600873))
* **client:** support proxy authentication ([2568fbd](https://github.com/CASParser/cas-parser-java/commit/2568fbd4e09f2788cb1b7f49ce00a83505bf2370))
* support setting headers via env ([ee0b90d](https://github.com/CASParser/cas-parser-java/commit/ee0b90db7cf144c61c23891ff8d026b0b6c358da))


### Performance Improvements

* **client:** create one json mapper ([720bb86](https://github.com/CASParser/cas-parser-java/commit/720bb86a8c014e99d8e3a3adbd14b5b9ee4d337a))


### Chores

* remove duplicated dokka setup ([2265192](https://github.com/CASParser/cas-parser-java/commit/226519252d2ec845c0ca05a13902c3574e0d33e2))


### Documentation

* clarify forwards compat behavior ([1181b47](https://github.com/CASParser/cas-parser-java/commit/1181b475ff522b2753786939e5b36e783ab78690))

## 0.6.0 (2026-04-19)

Full Changelog: [v0.5.4...v0.6.0](https://github.com/CASParser/cas-parser-java/compare/v0.5.4...v0.6.0)
Expand Down
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

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

[![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)
[![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)
[![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)
[![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)

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

Expand All @@ -22,7 +22,7 @@ Use the Cas Parser MCP Server to enable AI assistants to interact with this API,

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

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).
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).

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

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

```kotlin
implementation("com.cas_parser.api:cas-parser-java:0.6.0")
implementation("com.cas_parser.api:cas-parser-java:0.7.0")
```

### Maven
Expand All @@ -42,7 +42,7 @@ implementation("com.cas_parser.api:cas-parser-java:0.6.0")
<dependency>
<groupId>com.cas_parser.api</groupId>
<artifactId>cas-parser-java</artifactId>
<version>0.6.0</version>
<version>0.7.0</version>
</dependency>
```

Expand Down Expand Up @@ -236,8 +236,6 @@ The SDK throws custom unchecked exception types:

## Logging

The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).

Enable logging by setting the `CAS_PARSER_LOG` environment variable to `info`:

```sh
Expand All @@ -250,6 +248,19 @@ Or to `debug` for more verbose logging:
export CAS_PARSER_LOG=debug
```

Or configure the client manually using the `logLevel` method:

```java
import com.cas_parser.api.client.CasParserClient;
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
import com.cas_parser.api.core.LogLevel;

CasParserClient client = CasParserOkHttpClient.builder()
.fromEnv()
.logLevel(LogLevel.INFO)
.build();
```

## ProGuard and R8

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).
Expand Down Expand Up @@ -342,6 +353,21 @@ CasParserClient client = CasParserOkHttpClient.builder()
.build();
```

If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:

```java
import com.cas_parser.api.client.CasParserClient;
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
import com.cas_parser.api.core.http.ProxyAuthenticator;

CasParserClient client = CasParserOkHttpClient.builder()
.fromEnv()
.proxy(...)
// Or a custom implementation of `ProxyAuthenticator`.
.proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))
.build();
```

### Connection pooling

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

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.

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

If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:

```java
import com.cas_parser.api.models.credits.CreditCheckResponse;
Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {

allprojects {
group = "com.cas_parser.api"
version = "0.6.0" // x-release-please-version
version = "0.7.0" // x-release-please-version
}

subprojects {
Expand All @@ -22,7 +22,6 @@ subprojects {
group = "Verification"
description = "Verifies all source files are formatted."
}
apply(plugin = "org.jetbrains.dokka")
}

subprojects {
Expand Down
1 change: 0 additions & 1 deletion cas-parser-java-client-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ dependencies {
api(project(":cas-parser-java-core"))

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

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.27.7")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package com.cas_parser.api.client.okhttp
import com.cas_parser.api.client.CasParserClient
import com.cas_parser.api.client.CasParserClientImpl
import com.cas_parser.api.core.ClientOptions
import com.cas_parser.api.core.LogLevel
import com.cas_parser.api.core.Sleeper
import com.cas_parser.api.core.Timeout
import com.cas_parser.api.core.http.Headers
import com.cas_parser.api.core.http.HttpClient
import com.cas_parser.api.core.http.ProxyAuthenticator
import com.cas_parser.api.core.http.QueryParams
import com.cas_parser.api.core.jsonMapper
import com.fasterxml.jackson.databind.json.JsonMapper
Expand Down Expand Up @@ -47,6 +49,7 @@ class CasParserOkHttpClient private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var proxyAuthenticator: ProxyAuthenticator? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
Expand Down Expand Up @@ -77,6 +80,20 @@ class CasParserOkHttpClient private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional<Proxy>) = proxy(proxy.getOrNull())

/**
* Provides credentials when an HTTP proxy responds with `407 Proxy Authentication
* Required`.
*/
fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
this.proxyAuthenticator = proxyAuthenticator
}

/**
* Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`.
*/
fun proxyAuthenticator(proxyAuthenticator: Optional<ProxyAuthenticator>) =
proxyAuthenticator(proxyAuthenticator.getOrNull())

/**
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
*
Expand Down Expand Up @@ -217,6 +234,9 @@ class CasParserOkHttpClient private constructor() {
/**
* Whether to call `validate` on every response before returning it.
*
* Setting this to `true` is _not_ forwards compatible with new types from the API for
* existing fields.
*
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
Expand Down Expand Up @@ -258,6 +278,15 @@ class CasParserOkHttpClient private constructor() {
*/
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }

/**
* The level at which to log request and response information.
*
* [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
*
* Defaults to [LogLevel.fromEnv].
*/
fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) }

/** Your API key for authentication. Use `sandbox-with-json-responses` as Sandbox key. */
fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }

Expand Down Expand Up @@ -360,6 +389,7 @@ class CasParserOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
.proxyAuthenticator(proxyAuthenticator)
.maxIdleConnections(maxIdleConnections)
.keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package com.cas_parser.api.client.okhttp
import com.cas_parser.api.client.CasParserClientAsync
import com.cas_parser.api.client.CasParserClientAsyncImpl
import com.cas_parser.api.core.ClientOptions
import com.cas_parser.api.core.LogLevel
import com.cas_parser.api.core.Sleeper
import com.cas_parser.api.core.Timeout
import com.cas_parser.api.core.http.Headers
import com.cas_parser.api.core.http.HttpClient
import com.cas_parser.api.core.http.ProxyAuthenticator
import com.cas_parser.api.core.http.QueryParams
import com.cas_parser.api.core.jsonMapper
import com.fasterxml.jackson.databind.json.JsonMapper
Expand Down Expand Up @@ -47,6 +49,7 @@ class CasParserOkHttpClientAsync private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var proxyAuthenticator: ProxyAuthenticator? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
Expand Down Expand Up @@ -77,6 +80,20 @@ class CasParserOkHttpClientAsync private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional<Proxy>) = proxy(proxy.getOrNull())

/**
* Provides credentials when an HTTP proxy responds with `407 Proxy Authentication
* Required`.
*/
fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
this.proxyAuthenticator = proxyAuthenticator
}

/**
* Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`.
*/
fun proxyAuthenticator(proxyAuthenticator: Optional<ProxyAuthenticator>) =
proxyAuthenticator(proxyAuthenticator.getOrNull())

/**
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
*
Expand Down Expand Up @@ -217,6 +234,9 @@ class CasParserOkHttpClientAsync private constructor() {
/**
* Whether to call `validate` on every response before returning it.
*
* Setting this to `true` is _not_ forwards compatible with new types from the API for
* existing fields.
*
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
Expand Down Expand Up @@ -258,6 +278,15 @@ class CasParserOkHttpClientAsync private constructor() {
*/
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }

/**
* The level at which to log request and response information.
*
* [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
*
* Defaults to [LogLevel.fromEnv].
*/
fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) }

/** Your API key for authentication. Use `sandbox-with-json-responses` as Sandbox key. */
fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }

Expand Down Expand Up @@ -360,6 +389,7 @@ class CasParserOkHttpClientAsync private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
.proxyAuthenticator(proxyAuthenticator)
.maxIdleConnections(maxIdleConnections)
.keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
Expand Down
Loading
Loading