fix: make platformCustomerId optional in Kotlin sample#348
Merged
Conversation
Sync Kotlin sample with schema change from #345. The field is now optional with auto-generation when not provided. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummarySyncs the Kotlin sample with the schema change from #345 by making Confidence Score: 5/5Safe to merge — minimal, targeted fix with no logic concerns. Single-file change that correctly adapts to the schema update from #345. The optional pattern used ( No files require special attention.
|
| Filename | Overview |
|---|---|
| samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt | Moves platformCustomerId into the optional apply block using optText + let, matching the schema change in #345; removes now-unused requireText import. |
Sequence Diagram
sequenceDiagram
participant Client
participant KtorRoute as Kotlin Sample (POST /api/customers)
participant GridAPI as Grid API
Client->>KtorRoute: POST /api/customers { fullName, ... }
Note over KtorRoute: platformCustomerId is optional
alt platformCustomerId present in body
KtorRoute->>KtorRoute: optText("platformCustomerId")?.let { platformCustomerId(it) }
else platformCustomerId absent
KtorRoute->>KtorRoute: field skipped — API will auto-generate
end
KtorRoute->>GridAPI: customers().create(params)
GridAPI-->>KtorRoute: Customer (with auto or provided ID)
KtorRoute-->>Client: 201 Created (customer JSON)
Reviews (1): Last reviewed commit: "fix: make platformCustomerId optional in..." | Re-trigger Greptile
shreyav
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
platformCustomerIdas optional, syncing with schema change from make platformCustomerId optional on create customer #345requireTextimportContext
The schema change in #345 made
platformCustomerIdoptional on customer creation (if not provided, one is auto-generated). The Mintlify docs were updated in that same PR, but the Kotlin sample still usedrequireText()which would throw an error if the field was missing.Test plan
platformCustomerIdin request body🤖 Generated with Claude Code