Skip to content

feat: accept v1.0 PascalCase JSON-RPC method names#16

Open
zeroasterisk wants to merge 2 commits intoactioncard:mainfrom
zeroasterisk:feat/v1-method-names
Open

feat: accept v1.0 PascalCase JSON-RPC method names#16
zeroasterisk wants to merge 2 commits intoactioncard:mainfrom
zeroasterisk:feat/v1-method-names

Conversation

@zeroasterisk
Copy link
Copy Markdown

Part of #13 (A2A v1.0 Protocol Support)

What this PR does

Server (already present, minor fix)

The server's @method_aliases in lib/a2a/jsonrpc.ex already maps all 11 v1.0 PascalCase method names to internal slash-style names. This PR fixes the comment (was labeled "v0.3.0" → now "v1.0") and adds 4 missing test cases.

Client (lib/a2a/client.ex)

  • Client now sends v1.0 PascalCase method names by default (SendMessage, GetTask, CancelTask, SendStreamingMessage)
  • New :method_style option on A2A.Client.new/2:
    • :v1 (default) — PascalCase names per A2A v1.0 spec
    • :legacy — slash-style names for backward compatibility with v0.3 servers
  • Complete method name mapping for all 11 JSON-RPC methods

Tests

  • 4 new server-side PascalCase dispatch tests: SubscribeToTask, GetTaskPushNotificationConfig, ListTaskPushNotificationConfigs, DeleteTaskPushNotificationConfig
  • 4 new client method_style tests (v1 default + legacy fallback for send/get/cancel)
  • Updated existing client tests to expect PascalCase names
  • All 395 tests pass, 0 failures

Method mapping (all 11 from proto service A2AService)

v1.0 PascalCase Legacy slash-style
SendMessage message/send
SendStreamingMessage message/stream
GetTask tasks/get
CancelTask tasks/cancel
ListTasks tasks/list
SubscribeToTask tasks/resubscribe
CreateTaskPushNotificationConfig tasks/pushNotificationConfig/set
GetTaskPushNotificationConfig tasks/pushNotificationConfig/get
ListTaskPushNotificationConfigs tasks/pushNotificationConfig/list
DeleteTaskPushNotificationConfig tasks/pushNotificationConfig/delete
GetExtendedAgentCard agent/getAuthenticatedExtendedCard

No breaking changes — the server continues to accept both formats.

Fixes part of #13

Zaf Agent added 2 commits March 21, 2026 05:47
- Client now sends PascalCase method names (SendMessage, GetTask, etc.)
  matching the v1.0 A2A spec by default
- Add method_style option (:v1 default, :legacy for v0.3 servers)
- Server already accepted both formats via @method_aliases (fix comment)
- Add 4 missing PascalCase server dispatch tests (SubscribeToTask,
  GetTaskPushNotificationConfig, ListTaskPushNotificationConfigs,
  DeleteTaskPushNotificationConfig)
- Add 4 client method_style tests (v1 default + legacy fallback)
- All 397 tests pass, 0 failures
Existing users talking to v0.3 servers should not break when upgrading.
PascalCase is opt-in via method_style: :v1.
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.

1 participant