Java SDK

Official Java SDK for using the Moov API

SDK Installation

Getting started

JDK 11 or later is required.

The samples below show how a published SDK artifact is used:

Gradle:

1
implementation 'io.moov:sdk:0.13.2'

Maven:

1
2
3
4
5
<dependency>
    <groupId>io.moov</groupId>
    <artifactId>sdk</artifactId>
    <version>0.13.2</version>
</dependency>

How to build

After cloning the git repository to your file system you can build the SDK artifact from source to the build directory by running ./gradlew build on *nix systems or gradlew.bat on Windows systems.

If you wish to build from source and publish the SDK artifact to your local Maven repository (on your filesystem) then use the following command (after cloning the git repo locally):

On *nix:

1
./gradlew publishToMavenLocal -Pskip.signing

On Windows:

1
gradlew.bat publishToMavenLocal -Pskip.signing

Logging

A logging framework/facade has not yet been adopted but is under consideration.

For request and response logging (especially json bodies) use:

1
SpeakeasyHTTPClient.setDebugLogging(true); // experimental API only (may change without warning)

Example output:

1
2
3
4
5
6
7
8
9
Sending request: http://localhost:35123/bearer#global GET
Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]}
Received response: (GET http://localhost:35123/bearer#global) 200
Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]}
Response body:
{
  "authenticated": true, 
  "token": "global"
}

WARNING: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via SpeakeasyHTTPClient.setRedactedHeaders.

Another option is to set the System property -Djdk.httpclient.HttpClient.log=all. However, this second option does not log bodies.