Skip to content

Commit c38b158

Browse files
feat(api): updates
1 parent c1b531b commit c38b158

File tree

337 files changed

+21145
-8528
lines changed

Some content is hidden

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

337 files changed

+21145
-8528
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
6-
pull_request:
7-
branches:
8-
- main
9-
- next
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
1010

1111
jobs:
1212
lint:
13+
timeout-minutes: 10
1314
name: lint
14-
runs-on: ubuntu-latest
15-
15+
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
1616

1717
steps:
1818
- uses: actions/checkout@v4
@@ -23,7 +23,7 @@ jobs:
2323
distribution: temurin
2424
java-version: |
2525
8
26-
17
26+
21
2727
cache: gradle
2828

2929
- name: Set up Gradle
@@ -32,9 +32,9 @@ jobs:
3232
- name: Run lints
3333
run: ./scripts/lint
3434
test:
35+
timeout-minutes: 10
3536
name: test
36-
runs-on: ubuntu-latest
37-
37+
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
3838
steps:
3939
- uses: actions/checkout@v4
4040

@@ -44,7 +44,7 @@ jobs:
4444
distribution: temurin
4545
java-version: |
4646
8
47-
17
47+
21
4848
cache: gradle
4949

5050
- name: Set up Gradle

.github/workflows/publish-sonatype.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
export -- GPG_SIGNING_KEY_ID
3434
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
3535
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
36-
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
36+
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
3737
env:
3838
SONATYPE_USERNAME: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
3939
SONATYPE_PASSWORD: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}

.stats.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
configured_endpoints: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-6f08502508c8ad25235971add3124a1cde4f1c3ec705d5df455d750e0adcb90b.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-4fcbe9547537b22a2d68329e1d94e0c1a6f81b5af734ca213f7b95eef5da7adb.yml
3+
openapi_spec_hash: 417ea17b08e186b15b2986372592185e
4+
config_hash: 3871f5d21bb38ddd334ec04721dea64d

README.md

Lines changed: 88 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).
1515

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

18-
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). KDocs are also available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.66).
18+
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). KDocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.69).
1919

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

@@ -33,9 +33,9 @@ implementation("org.onebusaway:onebusaway-sdk-kotlin:0.1.0-alpha.69")
3333

3434
```xml
3535
<dependency>
36-
<groupId>org.onebusaway</groupId>
37-
<artifactId>onebusaway-sdk-kotlin</artifactId>
38-
<version>0.1.0-alpha.69</version>
36+
<groupId>org.onebusaway</groupId>
37+
<artifactId>onebusaway-sdk-kotlin</artifactId>
38+
<version>0.1.0-alpha.69</version>
3939
</dependency>
4040
```
4141

@@ -50,10 +50,10 @@ This library requires Java 8 or later.
5050
```kotlin
5151
import org.onebusaway.client.OnebusawaySdkClient
5252
import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient
53-
import org.onebusaway.models.CurrentTimeRetrieveParams
54-
import org.onebusaway.models.CurrentTimeRetrieveResponse
53+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams
54+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse
5555

56-
// Configures using the `ONEBUSAWAY_API_KEY` environment variable
56+
// Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
5757
val client: OnebusawaySdkClient = OnebusawaySdkOkHttpClient.fromEnv()
5858

5959
val currentTime: CurrentTimeRetrieveResponse = client.currentTime().retrieve()
@@ -67,7 +67,7 @@ Configure the client using environment variables:
6767
import org.onebusaway.client.OnebusawaySdkClient
6868
import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient
6969

70-
// Configures using the `ONEBUSAWAY_API_KEY` environment variable
70+
// Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
7171
val client: OnebusawaySdkClient = OnebusawaySdkOkHttpClient.fromEnv()
7272
```
7373

@@ -89,17 +89,18 @@ import org.onebusaway.client.OnebusawaySdkClient
8989
import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient
9090

9191
val client: OnebusawaySdkClient = OnebusawaySdkOkHttpClient.builder()
92-
// Configures using the `ONEBUSAWAY_API_KEY` environment variable
92+
// Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
9393
.fromEnv()
9494
.apiKey("My API Key")
9595
.build()
9696
```
9797

9898
See this table for the available options:
9999

100-
| Setter | Environment variable | Required | Default value |
101-
| -------- | -------------------- | -------- | ------------- |
102-
| `apiKey` | `ONEBUSAWAY_API_KEY` | true | - |
100+
| Setter | Environment variable | Required | Default value |
101+
| --------- | ------------------------- | -------- | ----------------------------------------- |
102+
| `apiKey` | `ONEBUSAWAY_API_KEY` | true | - |
103+
| `baseUrl` | `ONEBUSAWAY_SDK_BASE_URL` | true | `"https://api.pugetsound.onebusaway.org"` |
103104

104105
> [!TIP]
105106
> Don't create more than one client in the same application. Each client has a connection pool and
@@ -126,10 +127,10 @@ The default client is synchronous. To switch to asynchronous execution, call the
126127
```kotlin
127128
import org.onebusaway.client.OnebusawaySdkClient
128129
import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient
129-
import org.onebusaway.models.CurrentTimeRetrieveParams
130-
import org.onebusaway.models.CurrentTimeRetrieveResponse
130+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams
131+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse
131132

132-
// Configures using the `ONEBUSAWAY_API_KEY` environment variable
133+
// Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
133134
val client: OnebusawaySdkClient = OnebusawaySdkOkHttpClient.fromEnv()
134135

135136
val currentTime: CurrentTimeRetrieveResponse = client.async().currentTime().retrieve()
@@ -140,10 +141,10 @@ Or create an asynchronous client from the beginning:
140141
```kotlin
141142
import org.onebusaway.client.OnebusawaySdkClientAsync
142143
import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClientAsync
143-
import org.onebusaway.models.CurrentTimeRetrieveParams
144-
import org.onebusaway.models.CurrentTimeRetrieveResponse
144+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams
145+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse
145146

146-
// Configures using the `ONEBUSAWAY_API_KEY` environment variable
147+
// Configures using the `ONEBUSAWAY_API_KEY` and `ONEBUSAWAY_SDK_BASE_URL` environment variables
147148
val client: OnebusawaySdkClientAsync = OnebusawaySdkOkHttpClientAsync.fromEnv()
148149

149150
val currentTime: CurrentTimeRetrieveResponse = client.currentTime().retrieve()
@@ -160,8 +161,8 @@ To access this data, prefix any HTTP method call on a client or service with `wi
160161
```kotlin
161162
import org.onebusaway.core.http.Headers
162163
import org.onebusaway.core.http.HttpResponseFor
163-
import org.onebusaway.models.CurrentTimeRetrieveParams
164-
import org.onebusaway.models.CurrentTimeRetrieveResponse
164+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams
165+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse
165166

166167
val currentTime: HttpResponseFor<CurrentTimeRetrieveResponse> = client.currentTime().withRawResponse().retrieve()
167168

@@ -172,7 +173,7 @@ val headers: Headers = currentTime.headers()
172173
You can still deserialize the response into an instance of a Kotlin class if needed:
173174

174175
```kotlin
175-
import org.onebusaway.models.CurrentTimeRetrieveResponse
176+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse
176177

177178
val parsedCurrentTime: CurrentTimeRetrieveResponse = currentTime.parse()
178179
```
@@ -216,6 +217,17 @@ Or to `debug` for more verbose logging:
216217
$ export ONEBUSAWAY_SDK_LOG=debug
217218
```
218219

220+
## Jackson
221+
222+
The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.
223+
224+
The SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).
225+
226+
If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`OnebusawaySdkOkHttpClient`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClient.kt) or [`OnebusawaySdkOkHttpClientAsync`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClientAsync.kt).
227+
228+
> [!CAUTION]
229+
> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.
230+
219231
## Network options
220232

221233
### Retries
@@ -251,8 +263,7 @@ Requests time out after 1 minute by default.
251263
To set a custom timeout, configure the method call using the `timeout` method:
252264

253265
```kotlin
254-
import org.onebusaway.models.CurrentTimeRetrieveParams
255-
import org.onebusaway.models.CurrentTimeRetrieveResponse
266+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse
256267

257268
val currentTime: CurrentTimeRetrieveResponse = client.currentTime().retrieve(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build())
258269
```
@@ -290,6 +301,42 @@ val client: OnebusawaySdkClient = OnebusawaySdkOkHttpClient.builder()
290301
.build()
291302
```
292303

304+
### Custom HTTP client
305+
306+
The SDK consists of three artifacts:
307+
308+
- `onebusaway-sdk-kotlin-core`
309+
- Contains core SDK logic
310+
- Does not depend on [OkHttp](https://square.github.io/okhttp)
311+
- Exposes [`OnebusawaySdkClient`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClient.kt), [`OnebusawaySdkClientAsync`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientAsync.kt), [`OnebusawaySdkClientImpl`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientImpl.kt), and [`OnebusawaySdkClientAsyncImpl`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientAsyncImpl.kt), all of which can work with any HTTP client
312+
- `onebusaway-sdk-kotlin-client-okhttp`
313+
- Depends on [OkHttp](https://square.github.io/okhttp)
314+
- Exposes [`OnebusawaySdkOkHttpClient`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClient.kt) and [`OnebusawaySdkOkHttpClientAsync`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClientAsync.kt), which provide a way to construct [`OnebusawaySdkClientImpl`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientImpl.kt) and [`OnebusawaySdkClientAsyncImpl`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientAsyncImpl.kt), respectively, using OkHttp
315+
- `onebusaway-sdk-kotlin`
316+
- Depends on and exposes the APIs of both `onebusaway-sdk-kotlin-core` and `onebusaway-sdk-kotlin-client-okhttp`
317+
- Does not have its own logic
318+
319+
This structure allows replacing the SDK's default HTTP client without pulling in unnecessary dependencies.
320+
321+
#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)
322+
323+
> [!TIP]
324+
> Try the available [network options](#network-options) before replacing the default client.
325+
326+
To use a customized `OkHttpClient`:
327+
328+
1. Replace your [`onebusaway-sdk-kotlin` dependency](#installation) with `onebusaway-sdk-kotlin-core`
329+
2. Copy `onebusaway-sdk-kotlin-client-okhttp`'s [`OkHttpClient`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OkHttpClient.kt) class into your code and customize it
330+
3. Construct [`OnebusawaySdkClientImpl`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientImpl.kt) or [`OnebusawaySdkClientAsyncImpl`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientAsyncImpl.kt), similarly to [`OnebusawaySdkOkHttpClient`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClient.kt) or [`OnebusawaySdkOkHttpClientAsync`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClientAsync.kt), using your customized client
331+
332+
### Completely custom HTTP client
333+
334+
To use a completely custom HTTP client:
335+
336+
1. Replace your [`onebusaway-sdk-kotlin` dependency](#installation) with `onebusaway-sdk-kotlin-core`
337+
2. Write a class that implements the [`HttpClient`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/http/HttpClient.kt) interface
338+
3. Construct [`OnebusawaySdkClientImpl`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientImpl.kt) or [`OnebusawaySdkClientAsyncImpl`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/client/OnebusawaySdkClientAsyncImpl.kt), similarly to [`OnebusawaySdkOkHttpClient`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClient.kt) or [`OnebusawaySdkOkHttpClientAsync`](onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClientAsync.kt), using your new client class
339+
293340
## Undocumented API functionality
294341

295342
The SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.
@@ -300,7 +347,7 @@ To set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQu
300347

301348
```kotlin
302349
import org.onebusaway.core.JsonValue
303-
import org.onebusaway.models.CurrentTimeRetrieveParams
350+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams
304351

305352
val params: CurrentTimeRetrieveParams = CurrentTimeRetrieveParams.builder()
306353
.putAdditionalHeader("Secret-Header", "42")
@@ -314,7 +361,7 @@ These can be accessed on the built object later using the `_additionalHeaders()`
314361
To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/Values.kt) object to its setter:
315362

316363
```kotlin
317-
import org.onebusaway.models.CurrentTimeRetrieveParams
364+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams
318365

319366
val params: CurrentTimeRetrieveParams = CurrentTimeRetrieveParams.builder().build()
320367
```
@@ -354,6 +401,20 @@ val complexValue: JsonValue = JsonValue.from(mapOf(
354401
))
355402
```
356403

404+
Normally a `Builder` class's `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.
405+
406+
To forcibly omit a required parameter or property, pass [`JsonMissing`](onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/Values.kt):
407+
408+
```kotlin
409+
import org.onebusaway.core.JsonMissing
410+
import org.onebusaway.models.agency.AgencyRetrieveParams
411+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveParams
412+
413+
val params: CurrentTimeRetrieveParams = AgencyRetrieveParams.builder()
414+
.agencyId(JsonMissing.of())
415+
.build()
416+
```
417+
357418
### Response properties
358419

359420
To access undocumented response properties, call the `_additionalProperties()` method:
@@ -406,16 +467,15 @@ By default, the SDK will not throw an exception in this case. It will throw [`On
406467
If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
407468

408469
```kotlin
409-
import org.onebusaway.models.CurrentTimeRetrieveResponse
470+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse
410471

411472
val currentTime: CurrentTimeRetrieveResponse = client.currentTime().retrieve(params).validate()
412473
```
413474

414475
Or configure the method call to validate the response using the `responseValidation` method:
415476

416477
```kotlin
417-
import org.onebusaway.models.CurrentTimeRetrieveParams
418-
import org.onebusaway.models.CurrentTimeRetrieveResponse
478+
import org.onebusaway.models.currenttime.CurrentTimeRetrieveResponse
419479

420480
val currentTime: CurrentTimeRetrieveResponse = client.currentTime().retrieve(RequestOptions.builder().responseValidation(true).build())
421481
```

buildSrc/src/main/kotlin/onebusaway-sdk.kotlin.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99

1010
kotlin {
1111
jvmToolchain {
12-
languageVersion.set(JavaLanguageVersion.of(17))
12+
languageVersion.set(JavaLanguageVersion.of(21))
1313
}
1414

1515
compilerOptions {
@@ -34,8 +34,7 @@ configure<SpotlessExtension> {
3434
}
3535
}
3636

37-
// Run tests in parallel to some degree.
3837
tasks.withType<Test>().configureEach {
39-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
40-
forkEvery = 100
38+
systemProperty("junit.jupiter.execution.parallel.enabled", true)
39+
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
4140
}

gradle.properties

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
org.gradle.caching=true
2+
org.gradle.configuration-cache=true
23
org.gradle.parallel=true
34
org.gradle.daemon=false
4-
org.gradle.jvmargs=-Xmx4g
5-
kotlin.daemon.jvmargs=-Xmx4g
5+
# These options improve our compilation and test performance. They are inherited by the Kotlin daemon.
6+
org.gradle.jvmargs=\
7+
-Xms1g \
8+
-Xmx4g \
9+
-XX:+UseParallelGC \
10+
-XX:InitialCodeCacheSize=256m \
11+
-XX:ReservedCodeCacheSize=1G \
12+
-XX:MetaspaceSize=256m \
13+
-XX:TieredStopAtLevel=1 \
14+
-XX:GCTimeRatio=4 \
15+
-XX:CICompilerCount=4 \
16+
-XX:+OptimizeStringConcat \
17+
-XX:+UseStringDeduplication

onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClient.kt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,20 @@ class OnebusawaySdkOkHttpClient private constructor() {
2929
class Builder internal constructor() {
3030

3131
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
32-
private var baseUrl: String = ClientOptions.PRODUCTION_URL
3332
private var timeout: Timeout = Timeout.default()
3433
private var proxy: Proxy? = null
3534

36-
fun baseUrl(baseUrl: String) = apply {
37-
clientOptions.baseUrl(baseUrl)
38-
this.baseUrl = baseUrl
35+
fun baseUrl(baseUrl: String) = apply { clientOptions.baseUrl(baseUrl) }
36+
37+
/**
38+
* Whether to throw an exception if any of the Jackson versions detected at runtime are
39+
* incompatible with the SDK's minimum supported Jackson version (2.13.4).
40+
*
41+
* Defaults to true. Use extreme caution when disabling this option. There is no guarantee
42+
* that the SDK will work correctly when using an incompatible Jackson version.
43+
*/
44+
fun checkJacksonVersionCompatibility(checkJacksonVersionCompatibility: Boolean) = apply {
45+
clientOptions.checkJacksonVersionCompatibility(checkJacksonVersionCompatibility)
3946
}
4047

4148
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }
@@ -158,7 +165,7 @@ class OnebusawaySdkOkHttpClient private constructor() {
158165
clientOptions
159166
.httpClient(
160167
OkHttpClient.builder()
161-
.baseUrl(baseUrl)
168+
.baseUrl(clientOptions.baseUrl())
162169
.timeout(timeout)
163170
.proxy(proxy)
164171
.build()

0 commit comments

Comments
 (0)