Skip to content

release: 0.1.0-alpha.25 #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2025
Merged
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
- uses: actions/checkout@v4
Expand All @@ -35,6 +40,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand Down
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.1.0-alpha.24"
".": "0.1.0-alpha.25"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.25 (2025-07-07)

Full Changelog: [v0.1.0-alpha.24...v0.1.0-alpha.25](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.24...v0.1.0-alpha.25)

### Chores

* **internal:** version bump ([97b8b21](https://github.com/OneBusAway/java-sdk/commit/97b8b21fb686dbf3ec55c42b57a69353a14ee6e8))

## 0.1.0-alpha.24 (2025-07-07)

Full Changelog: [v0.1.0-alpha.23...v0.1.0-alpha.24](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.23...v0.1.0-alpha.24)
Expand Down
25 changes: 20 additions & 5 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/org.onebusaway/onebusaway-sdk-java)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.24)
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.24/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.24)
[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-java)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.25)
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.25/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.25)

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

Expand All @@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).

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

The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). Javadocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.24).
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). Javadocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.25).

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

Expand All @@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.onebusaway.org](https://de
### Gradle

```kotlin
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.24")
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.25")
```

### Maven
Expand All @@ -35,7 +35,7 @@ implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.24")
<dependency>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-sdk-java</artifactId>
<version>0.1.0-alpha.24</version>
<version>0.1.0-alpha.25</version>
</dependency>
```

Expand Down Expand Up @@ -106,6 +106,21 @@ See this table for the available options:
> Don't create more than one client in the same application. Each client has a connection pool and
> thread pools, which are more efficient to share between requests.

### Modifying configuration

To temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:

```java
import org.onebusaway.client.OnebusawaySdkClient;

OnebusawaySdkClient clientWithOptions = client.withOptions(optionsBuilder -> {
optionsBuilder.baseUrl("https://example.com");
optionsBuilder.maxRetries(42);
});
```

The `withOptions()` method does not affect the original client or service.

## Requests and responses

To send a request to the Onebusaway SDK API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Onebusaway SDK please follow the respective company's security reporting guidelines.
or products provided by Onebusaway SDK, please follow the respective company's security reporting guidelines.

### Onebusaway SDK Terms and Policies

Please contact [email protected] for any questions or concerns regarding security of our services.
Please contact [email protected] for any questions or concerns regarding the security of our services.

---

Expand Down
8 changes: 4 additions & 4 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
errors=()

if [ -z "${SONATYPE_USERNAME}" ]; then
errors+=("The ONEBUSAWAY_SDK_SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
errors+=("The SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

if [ -z "${SONATYPE_PASSWORD}" ]; then
errors+=("The ONEBUSAWAY_SDK_SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
errors+=("The SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

if [ -z "${GPG_SIGNING_KEY}" ]; then
errors+=("The ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
errors+=("The GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

if [ -z "${GPG_SIGNING_PASSWORD}" ]; then
errors+=("The ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
errors+=("The GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

lenErrors=${#errors[@]}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "org.onebusaway"
version = "0.1.0-alpha.24" // x-release-please-version
version = "0.1.0-alpha.25" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import java.time.Duration
import java.util.concurrent.CompletableFuture
import okhttp3.Call
import okhttp3.Callback
import okhttp3.HttpUrl
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Interceptor
import okhttp3.MediaType
Expand All @@ -20,7 +19,6 @@ import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink
import org.onebusaway.core.RequestOptions
import org.onebusaway.core.Timeout
import org.onebusaway.core.checkRequired
import org.onebusaway.core.http.Headers
import org.onebusaway.core.http.HttpClient
import org.onebusaway.core.http.HttpMethod
Expand All @@ -29,8 +27,7 @@ import org.onebusaway.core.http.HttpRequestBody
import org.onebusaway.core.http.HttpResponse
import org.onebusaway.errors.OnebusawaySdkIoException

class OkHttpClient
private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :
class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpClient) :
HttpClient {

override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
Expand Down Expand Up @@ -142,11 +139,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
}

private fun HttpRequest.toUrl(): String {
url?.let {
return it
}

val builder = baseUrl.newBuilder()
val builder = baseUrl.toHttpUrl().newBuilder()
pathSegments.forEach(builder::addPathSegment)
queryParams.keys().forEach { key ->
queryParams.values(key).forEach { builder.addQueryParameter(key, it) }
Expand Down Expand Up @@ -196,12 +189,9 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val

class Builder internal constructor() {

private var baseUrl: HttpUrl? = null
private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null

fun baseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl.toHttpUrl() }

fun timeout(timeout: Timeout) = apply { this.timeout = timeout }

fun timeout(timeout: Duration) = timeout(Timeout.builder().request(timeout).build())
Expand All @@ -216,8 +206,12 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
.writeTimeout(timeout.write())
.callTimeout(timeout.request())
.proxy(proxy)
.build(),
checkRequired("baseUrl", baseUrl),
.build()
.apply {
// We usually make all our requests to the same host so it makes sense to
// raise the per-host limit to the overall limit.
dispatcher.maxRequestsPerHost = dispatcher.maxRequests
}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,7 @@ class OnebusawaySdkOkHttpClient private constructor() {
fun build(): OnebusawaySdkClient =
OnebusawaySdkClientImpl(
clientOptions
.httpClient(
OkHttpClient.builder()
.baseUrl(clientOptions.baseUrl())
.timeout(timeout)
.proxy(proxy)
.build()
)
.httpClient(OkHttpClient.builder().timeout(timeout).proxy(proxy).build())
.build()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,7 @@ class OnebusawaySdkOkHttpClientAsync private constructor() {
fun build(): OnebusawaySdkClientAsync =
OnebusawaySdkClientAsyncImpl(
clientOptions
.httpClient(
OkHttpClient.builder()
.baseUrl(clientOptions.baseUrl())
.timeout(timeout)
.proxy(proxy)
.build()
)
.httpClient(OkHttpClient.builder().timeout(timeout).proxy(proxy).build())
.build()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

package org.onebusaway.client

import java.util.function.Consumer
import org.onebusaway.core.ClientOptions
import org.onebusaway.services.blocking.AgenciesWithCoverageService
import org.onebusaway.services.blocking.AgencyService
import org.onebusaway.services.blocking.ArrivalAndDepartureService
Expand Down Expand Up @@ -60,6 +62,13 @@ interface OnebusawaySdkClient {
*/
fun withRawResponse(): WithRawResponse

/**
* Returns a view of this service with the given option modifications applied.
*
* The original service is not modified.
*/
fun withOptions(modifier: Consumer<ClientOptions.Builder>): OnebusawaySdkClient

fun agenciesWithCoverage(): AgenciesWithCoverageService

fun agency(): AgencyService
Expand Down Expand Up @@ -134,6 +143,15 @@ interface OnebusawaySdkClient {
*/
interface WithRawResponse {

/**
* Returns a view of this service with the given option modifications applied.
*
* The original service is not modified.
*/
fun withOptions(
modifier: Consumer<ClientOptions.Builder>
): OnebusawaySdkClient.WithRawResponse

fun agenciesWithCoverage(): AgenciesWithCoverageService.WithRawResponse

fun agency(): AgencyService.WithRawResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

package org.onebusaway.client

import java.util.function.Consumer
import org.onebusaway.core.ClientOptions
import org.onebusaway.services.async.AgenciesWithCoverageServiceAsync
import org.onebusaway.services.async.AgencyServiceAsync
import org.onebusaway.services.async.ArrivalAndDepartureServiceAsync
Expand Down Expand Up @@ -60,6 +62,13 @@ interface OnebusawaySdkClientAsync {
*/
fun withRawResponse(): WithRawResponse

/**
* Returns a view of this service with the given option modifications applied.
*
* The original service is not modified.
*/
fun withOptions(modifier: Consumer<ClientOptions.Builder>): OnebusawaySdkClientAsync

fun agenciesWithCoverage(): AgenciesWithCoverageServiceAsync

fun agency(): AgencyServiceAsync
Expand Down Expand Up @@ -135,6 +144,15 @@ interface OnebusawaySdkClientAsync {
*/
interface WithRawResponse {

/**
* Returns a view of this service with the given option modifications applied.
*
* The original service is not modified.
*/
fun withOptions(
modifier: Consumer<ClientOptions.Builder>
): OnebusawaySdkClientAsync.WithRawResponse

fun agenciesWithCoverage(): AgenciesWithCoverageServiceAsync.WithRawResponse

fun agency(): AgencyServiceAsync.WithRawResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package org.onebusaway.client

import java.util.function.Consumer
import org.onebusaway.core.ClientOptions
import org.onebusaway.core.getPackageVersion
import org.onebusaway.services.async.AgenciesWithCoverageServiceAsync
Expand Down Expand Up @@ -191,6 +192,9 @@ class OnebusawaySdkClientAsyncImpl(private val clientOptions: ClientOptions) :

override fun withRawResponse(): OnebusawaySdkClientAsync.WithRawResponse = withRawResponse

override fun withOptions(modifier: Consumer<ClientOptions.Builder>): OnebusawaySdkClientAsync =
OnebusawaySdkClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())

override fun agenciesWithCoverage(): AgenciesWithCoverageServiceAsync = agenciesWithCoverage

override fun agency(): AgencyServiceAsync = agency
Expand Down Expand Up @@ -366,6 +370,13 @@ class OnebusawaySdkClientAsyncImpl(private val clientOptions: ClientOptions) :
ShapeServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}

override fun withOptions(
modifier: Consumer<ClientOptions.Builder>
): OnebusawaySdkClientAsync.WithRawResponse =
OnebusawaySdkClientAsyncImpl.WithRawResponseImpl(
clientOptions.toBuilder().apply(modifier::accept).build()
)

override fun agenciesWithCoverage(): AgenciesWithCoverageServiceAsync.WithRawResponse =
agenciesWithCoverage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package org.onebusaway.client

import java.util.function.Consumer
import org.onebusaway.core.ClientOptions
import org.onebusaway.core.getPackageVersion
import org.onebusaway.services.blocking.AgenciesWithCoverageService
Expand Down Expand Up @@ -182,6 +183,9 @@ class OnebusawaySdkClientImpl(private val clientOptions: ClientOptions) : Onebus

override fun withRawResponse(): OnebusawaySdkClient.WithRawResponse = withRawResponse

override fun withOptions(modifier: Consumer<ClientOptions.Builder>): OnebusawaySdkClient =
OnebusawaySdkClientImpl(clientOptions.toBuilder().apply(modifier::accept).build())

override fun agenciesWithCoverage(): AgenciesWithCoverageService = agenciesWithCoverage

override fun agency(): AgencyService = agency
Expand Down Expand Up @@ -355,6 +359,13 @@ class OnebusawaySdkClientImpl(private val clientOptions: ClientOptions) : Onebus
ShapeServiceImpl.WithRawResponseImpl(clientOptions)
}

override fun withOptions(
modifier: Consumer<ClientOptions.Builder>
): OnebusawaySdkClient.WithRawResponse =
OnebusawaySdkClientImpl.WithRawResponseImpl(
clientOptions.toBuilder().apply(modifier::accept).build()
)

override fun agenciesWithCoverage(): AgenciesWithCoverageService.WithRawResponse =
agenciesWithCoverage

Expand Down
Loading
Loading