Skip to content

fix(jsonrpc): reject Part with multiple populated content keys - #1065

Merged
ehsavoie merged 1 commit into
a2aproject:mainfrom
kabir:reject-ambiguous-part-keys
Aug 13, 2026
Merged

ehsavoie merged 1 commit into
a2aproject:mainfrom
kabir:reject-ambiguous-part-keys

Conversation

@kabir

@kabir kabir commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Root cause

The deserializer silently accepted a Part with e.g. both "text": "hello" and "data": {"answer": "42"} populated, picking whichever key appeared first in document order. This hid malformed input that violates the spec's oneOf constraint.

Validation

This fixes #1062

🤖 Generated with Claude Code

Part is a oneOf in the A2A spec, so having more than one populated
content key (e.g. both "text" and "data" with non-empty values) is
ambiguous and invalid. Previously this was silently accepted, picking
whichever key appeared first in document order.

Now throws JsonSyntaxException when multiple populated content keys
are present. Empty-string placeholders (from protobuf serializers)
are still tolerated as before.

This fixes a2aproject#1062

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Kabir Khan <[email protected]>
@ehsavoie
ehsavoie merged commit 8615f37 into a2aproject:main Aug 13, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Part decoding discards a populated content key when an empty placeholder precedes it

2 participants