Skip to content

Commit a79ac8b

Browse files
claude[bot]github-actions[bot]claude
authored
fix: make platformCustomerId optional in Kotlin sample (#348)
## Summary - Update Kotlin sample to treat `platformCustomerId` as optional, syncing with schema change from #345 - Remove unused `requireText` import ## Context The schema change in #345 made `platformCustomerId` optional on customer creation (if not provided, one is auto-generated). The Mintlify docs were updated in that same PR, but the Kotlin sample still used `requireText()` which would throw an error if the field was missing. ## Test plan - [ ] Verify Kotlin sample compiles - [ ] Test customer creation without `platformCustomerId` in request body 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 285910b commit a79ac8b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • samples/kotlin/src/main/kotlin/com/grid/sample/routes

samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import com.grid.sample.GridClientBuilder
99
import com.grid.sample.JsonUtils
1010
import com.grid.sample.Log
1111
import com.grid.sample.optText
12-
import com.grid.sample.requireText
1312
import io.ktor.http.*
1413
import io.ktor.server.request.*
1514
import io.ktor.server.response.*
@@ -26,8 +25,8 @@ fun Route.customerRoutes() {
2625

2726
val individual = CreateCustomerRequest.Individual.builder()
2827
.customerType(IndividualCustomerFields.CustomerType.INDIVIDUAL)
29-
.platformCustomerId(json.requireText("platformCustomerId"))
3028
.apply {
29+
json.optText("platformCustomerId")?.let { platformCustomerId(it) }
3130
json.optText("fullName")?.let { fullName(it) }
3231
json.optText("nationality")?.let { nationality(it) }
3332
json.optText("birthDate")?.let { birthDate(LocalDate.parse(it)) }

0 commit comments

Comments
 (0)