A Kotlin library containing parsers and models for Frab-compatible conference schedule JSON versions 1 and 2, as used by apps such as:
The library is published as two separate artifacts: schedule-base and schedule-repositories.
You can use either of them depending on your needs.
The schedule-base artifact provides Retrofit services for both schedule
formats. The suspending ScheduleService#getScheduleV1 and
ScheduleService#getScheduleV2 functions return Response<ScheduleV1> and
Response<ScheduleV2>, respectively. Choose the function that matches the
JSON format served by the conference.
suspend fun loadSchedule(okHttpClient: Call.Factory, logging: Logging) {
val api: ScheduleApi = Api
val service: ScheduleService = api.provideScheduleService(
baseUrl = "https://some.event.com/schedules/",
callFactory = okHttpClient,
logging = logging,
)
val requestETag = "" // Pass an empty string or a previous ETag value for caching
val requestLastModifiedAt = "" // Pass an empty string or a previous Last-Modified value for caching
val response = service.getScheduleV1(
eTag = requestETag,
lastModifiedAt = requestLastModifiedAt,
path = "schedule.json",
)
if (response.isSuccessful) {
val scheduleV1 = response.body()
val responseETag = response.headers()["ETag"]
val responseLastModifiedAt = response.headers()["Last-Modified"]
} else {
val errorCode = response.code()
val errorMessage = response.message()
}
}The schedule-repositories artifact provides a Flow-based API for both
formats. Call ScheduleRepository#getScheduleV1State for v1
(Flow<GetScheduleV1State>) or ScheduleRepository#getScheduleV2State for
v2 (Flow<GetScheduleV2State>). The simple repository implementation is
SimpleScheduleRepository.
suspend fun loadSchedule(okHttpClient: Call.Factory, logging: Logging) {
val repository: ScheduleRepository = SimpleScheduleRepository(
callFactory = okHttpClient,
logging = logging,
api = Api,
)
val requestETag = "" // Pass an empty string or a previous ETag value for caching
val requestLastModifiedAt = "" // Pass an empty string or a previous Last-Modified value for caching
repository.getScheduleV1State(
url = "https://some.event.com/schedules/schedule.json",
requestETag = requestETag,
lastModifiedAt = requestLastModifiedAt,
).collectLatest { state ->
when (state) {
is Success -> {
val scheduleV1 = state.scheduleV1
val responseETag = state.responseETag
val responseLastModifiedAt = state.responseLastModifiedAt
}
is Error -> {
val httpStatusCode = state.httpStatusCode
val errorMessage = state.errorMessage
}
is Failure -> {
val throwable = state.throwable
}
}
}
}The v2 model is available under info.metadude.kotlin.library.schedule.v2.models.
It represents scheduled events, planned (not yet scheduled) events and meta events
separately, supports localized strings and v2 date and time types, ignores unknown
JSON object keys, and maps unrecognized enum values to UNKNOWN where the format
defines an enum fallback. Missing required fields still cause parsing to fail.
To use v2 with schedule-base, call ScheduleService#getScheduleV2, which
returns Response<ScheduleV2>. To use v2 with schedule-repositories, call
ScheduleRepository#getScheduleV2State, which returns Flow<GetScheduleV2State>.
Its Success state exposes scheduleV2, and its Error and Failure states
report HTTP errors and thrown exceptions, respectively.
To deploy the library to your local Maven repository run the following task:
$ ./gradlew publishToMavenLocalThen, to use the library in your project add the following to
your top level build.gradle:
allprojects {
repositories {
mavenLocal()
}
}and one of the following dependencies to your application module build.gradle:
dependencies {
implementation "info.metadude.kotlin.library.schedule:schedule-base:$version"
implementation "info.metadude.kotlin.library.schedule:schedule-repositories:$version"
}Run the following command to execute all tests:
$ ./gradlew clean testCopyright 2026 Tobias Preuss
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.