Skip to content

Kotlin sdk custom validation errors#1397

Merged
jgindin merged 1 commit into
google:mainfrom
jgindin:kotlin-sdk-custom-validation-errors
May 19, 2026
Merged

Kotlin sdk custom validation errors#1397
jgindin merged 1 commit into
google:mainfrom
jgindin:kotlin-sdk-custom-validation-errors

Conversation

@jgindin
Copy link
Copy Markdown
Collaborator

@jgindin jgindin commented May 11, 2026

Description

Implements custom JSON-path validation error string construction for v0.9 payloads in Kotlin, matching Python exactly. Validates messages individually via sub-validators and iterates component arrays to construct precise path prefixes.

Port of Python SDK commit 15ee789

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

@jgindin jgindin requested a review from nan-yu May 11, 2026 16:25
@jgindin jgindin self-assigned this May 11, 2026
@github-project-automation github-project-automation Bot moved this to Todo in A2UI May 11, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive streaming parser for A2UI (v0.8 and v0.9), including a base StreamingParser class and version-specific implementations. It also enhances schema management with new pruning capabilities for components, messages, and common types, and improves validation logic with more precise error reporting. Feedback includes suggestions to optimize regex compilation and object creation for better performance, handling potentially destructive path logic in v0.8, and adding checks for duplicate component IDs to ensure unambiguous error paths.

Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/core/parser/StreamingParser.kt Outdated
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/core/parser/StreamingParser.kt Outdated
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/core/parser/StreamingParser.kt Outdated
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/core/parser/StreamingParser.kt Outdated
@jgindin jgindin force-pushed the kotlin-sdk-custom-validation-errors branch 3 times, most recently from c6e2b7f to c233336 Compare May 12, 2026 15:51
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/core/schema/Validator.kt Outdated
@jgindin jgindin force-pushed the kotlin-sdk-custom-validation-errors branch 8 times, most recently from 23399c5 to c63c64f Compare May 19, 2026 16:31
@jgindin jgindin requested a review from nan-yu May 19, 2026 16:37
@jgindin jgindin force-pushed the kotlin-sdk-custom-validation-errors branch from c63c64f to 909ecb8 Compare May 19, 2026 19:56
Implements custom JSON-path validation error string construction for
v0.9 payloads in Kotlin, matching Python exactly. Validates messages
individually via sub-validators and iterates component arrays to
construct precise path prefixes.

Port of Python SDK commit 15ee789

� Conflicts:
�	agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/core/parser/StreamingParser.kt
�	agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/core/schema/Validator.kt
@jgindin jgindin force-pushed the kotlin-sdk-custom-validation-errors branch from 909ecb8 to e3dd9fa Compare May 19, 2026 20:03
@jgindin jgindin merged commit 91e02a3 into google:main May 19, 2026
18 checks passed
@jgindin jgindin deleted the kotlin-sdk-custom-validation-errors branch May 19, 2026 20:08
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants