Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/open-transit-java'
id: github-oidc
uses: actions/github-script@v6
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

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.48"
".": "0.1.0-alpha.49"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.1.0-alpha.49 (2026-01-24)

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

### Bug Fixes

* **client:** preserve time zone in lenient date-time parsing ([99572e3](https://github.com/OneBusAway/java-sdk/commit/99572e3a8c05fb5d37d5ba1ed63aae58a49326d6))


### Chores

* **ci:** upgrade `actions/github-script` ([7501fdc](https://github.com/OneBusAway/java-sdk/commit/7501fdca0669d7c6492620d8ab92206357fd142b))
* **internal:** correct cache invalidation for `SKIP_MOCK_TESTS` ([2625cdd](https://github.com/OneBusAway/java-sdk/commit/2625cddb2178d4c800e97f12440f51d96cc22a97))

## 0.1.0-alpha.48 (2026-01-22)

Full Changelog: [v0.1.0-alpha.47...v0.1.0-alpha.48](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.47...v0.1.0-alpha.48)
Expand Down
10 changes: 5 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.48)
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.48/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.48)
[![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.49)
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.49/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.49)

<!-- 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.48).
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.49).

<!-- 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.48")
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.49")
```

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

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.48" // x-release-please-version
version = "0.1.0-alpha.49" // x-release-please-version
}

subprojects {
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/onebusaway-sdk.kotlin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ kotlin {
tasks.withType<Test>().configureEach {
systemProperty("junit.jupiter.execution.parallel.enabled", true)
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")

// `SKIP_MOCK_TESTS` affects which tests run so it must be added as input for proper cache invalidation.
inputs.property("skipMockTests", System.getenv("SKIP_MOCK_TESTS")).optional(true)
}

val ktfmt by configurations.creating
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import java.time.DateTimeException
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.OffsetDateTime
import java.time.ZonedDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.time.temporal.ChronoField

Expand Down Expand Up @@ -157,14 +157,15 @@ private class LenientOffsetDateTimeDeserializer :
val temporal = formatter.parse(p.text)

return when {
!temporal.isSupported(ChronoField.HOUR_OF_DAY) ->
LocalDate.from(temporal).atStartOfDay()
!temporal.isSupported(ChronoField.OFFSET_SECONDS) ->
LocalDateTime.from(temporal)
else -> ZonedDateTime.from(temporal).toLocalDateTime()
}
.atZone(context.timeZone.toZoneId())
.toOffsetDateTime()
!temporal.isSupported(ChronoField.HOUR_OF_DAY) ->
LocalDate.from(temporal)
.atStartOfDay()
.atZone(ZoneId.of("UTC"))
.toOffsetDateTime()
!temporal.isSupported(ChronoField.OFFSET_SECONDS) ->
LocalDateTime.from(temporal).atZone(ZoneId.of("UTC")).toOffsetDateTime()
else -> OffsetDateTime.from(temporal)
}
} catch (e: DateTimeException) {
exceptions.add(e)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package org.onebusaway.core
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.exc.MismatchedInputException
import com.fasterxml.jackson.module.kotlin.readValue
import java.time.LocalDate
import java.time.LocalTime
import java.time.OffsetDateTime
import java.time.ZoneOffset
import kotlin.reflect.KClass
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.catchThrowable
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertDoesNotThrow
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.EnumSource
import org.junitpioneer.jupiter.cartesian.CartesianTest
Expand Down Expand Up @@ -72,11 +74,34 @@ internal class ObjectMappersTest {
}
}

enum class LenientOffsetDateTimeTestCase(val string: String) {
DATE("1998-04-21"),
DATE_TIME("1998-04-21T04:00:00"),
ZONED_DATE_TIME_1("1998-04-21T04:00:00+03:00"),
ZONED_DATE_TIME_2("1998-04-21T04:00:00Z"),
enum class LenientOffsetDateTimeTestCase(
val string: String,
val expectedOffsetDateTime: OffsetDateTime,
) {
DATE(
"1998-04-21",
expectedOffsetDateTime =
OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(0, 0), ZoneOffset.UTC),
),
DATE_TIME(
"1998-04-21T04:00:00",
expectedOffsetDateTime =
OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(4, 0), ZoneOffset.UTC),
),
ZONED_DATE_TIME_1(
"1998-04-21T04:00:00+03:00",
expectedOffsetDateTime =
OffsetDateTime.of(
LocalDate.of(1998, 4, 21),
LocalTime.of(4, 0),
ZoneOffset.ofHours(3),
),
),
ZONED_DATE_TIME_2(
"1998-04-21T04:00:00Z",
expectedOffsetDateTime =
OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(4, 0), ZoneOffset.UTC),
),
}

@ParameterizedTest
Expand All @@ -85,6 +110,8 @@ internal class ObjectMappersTest {
val jsonMapper = jsonMapper()
val json = jsonMapper.writeValueAsString(testCase.string)

assertDoesNotThrow { jsonMapper().readValue<OffsetDateTime>(json) }
val offsetDateTime = jsonMapper().readValue<OffsetDateTime>(json)

assertThat(offsetDateTime).isEqualTo(testCase.expectedOffsetDateTime)
}
}