Skip to content

Commit f6c3370

Browse files
SK-3061: fix Bulk Insert README's Token snippet to actually iterate the response (#411)
The snippet added when getTokens() was made typed (#408) used `record` without ever introducing it - it reads as if it stood alone, but record only exists inside a loop over insertResponse.getRecords(). Wrapped it in that outer loop (plus a null check, since getTokens() is null on a failed record), matching the pattern the Bulk Detokenize section's equivalent metadata snippet already follows. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 454f3ec commit f6c3370

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

flowvault/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,12 @@ Sample response:
485485
`getTokens()` returns `Map<String, List<Token>>` — one entry per token group configured on that column, so a column with a single token group still comes back as a one-element list, not a bare string. On the wire the API models this generically (`Object`, not a fixed type) to stay flexible, but the SDK parses it into `Token` objects before handing it back, so callers get `Token.getToken()`/`Token.getTokenGroupName()` directly with no casting required:
486486

487487
```java
488-
for (Token token : record.getTokens().get("card_number")) {
489-
System.out.println(token.getTokenGroupName() + " -> " + token.getToken());
488+
for (BulkInsertResponseRecord record : insertResponse.getRecords()) {
489+
if (record.getTokens() != null) {
490+
for (Token token : record.getTokens().get("card_number")) {
491+
System.out.println(token.getTokenGroupName() + " -> " + token.getToken());
492+
}
493+
}
490494
}
491495
```
492496

0 commit comments

Comments
 (0)