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
4 changes: 3 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"Bash(/usr/libexec/java_home:*)",
"Bash(./gradlew clean test:*)",
"Bash(./gradlew:*)",
"Bash(./gradlew build:*)"
"Bash(./gradlew build:*)",
"Bash(gh pr *)",
"Bash(gh issue *)"
Comment thread
googsvg marked this conversation as resolved.
]
}
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
Valid values are strings `"1"` through `"11"`.
See [Google Calendar Colors](https://developers.google.com/calendar/api/v3/reference/colors).

### Fixed
* `Configuration.participants` now defaults to an empty list when the field is absent from the API response (e.g. group-event configurations), preventing a `JsonDataException` from being thrown during deserialization.

## [v2.15.1] - Release 2026-03-30

### Changed
Expand Down
7 changes: 5 additions & 2 deletions src/main/kotlin/com/nylas/models/Scheduler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ data class Configuration(
@Json(name = "id")
val id: String,
/**
* List of participants included in the scheduled event.
* List of participants included in the scheduled event. The Nylas API
* omits this field for group-event configurations, so default to an
* empty list to avoid a JsonDataException on deserialization while
* keeping the property's runtime type unchanged for existing callers.
*/
@Json(name = "participants")
val participants: List<ConfigurationParticipant>,
val participants: List<ConfigurationParticipant> = emptyList(),
/**
* Rules that determine available time slots for the event.
*/
Expand Down
22 changes: 22 additions & 0 deletions src/test/kotlin/com/nylas/resources/ConfigurationsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,28 @@ class ConfigurationsTest {
assertEquals("Custom Body", emailTemplate.bookingConfirmed?.body)
}

@Test
fun `Configuration without participants field deserializes to empty list`() {
val adapter = JsonHelper.moshi().adapter(Configuration::class.java)
val jsonBuffer = Buffer().writeUtf8(
"""
{
"id": "group-config-id",
"availability": {
"duration_minutes": 30
},
"event_booking": {
"title": "Group Event"
}
}
""".trimIndent(),
)
val config = adapter.fromJson(jsonBuffer)!!
assertIs<Configuration>(config)
assertEquals("group-config-id", config.id)
assertEquals(emptyList(), config.participants)
}

@Test
fun `AdditionalFieldType METADATA serializes correctly`() {
val adapter = JsonHelper.moshi().adapter(AdditionalField::class.java)
Expand Down
Loading