fix: Extract taskId from URL path in HTTP+JSON CreateTaskPushNotifica…#734
fix: Extract taskId from URL path in HTTP+JSON CreateTaskPushNotifica…#734kabir merged 2 commits intoa2aproject:mainfrom
Conversation
…tionConfig
Per HTTP+JSON spec with body: "*", taskId should be extracted from the URL
path /tasks/{taskId}/pushNotificationConfigs, not required in request body.
Fixes a2aproject#732
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a compliance issue with the HTTP+JSON specification for creating task push notification configurations. It ensures that the Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes an issue in the createTaskPushNotificationConfiguration method where the taskId from the URL path was ignored. The change ensures the taskId from the path parameter is used, aligning with the HTTP+JSON specification. I have added one suggestion to make the implementation stricter by validating that if a taskId is present in the request body, it matches the one in the URL path. This would provide better error feedback to clients.
transport/rest/src/main/java/io/a2a/transport/rest/handler/RestHandler.java
Show resolved
Hide resolved
|
Shouldn't the RestHandlerTest cover that ? testPushNotificationConfigSuccess is using both ids, but I'd like to see the same test without the taskId in the payload |
…tionConfig
Per HTTP+JSON spec with body: "*", taskId should be extracted from the URL path /tasks/{taskId}/pushNotificationConfigs, not required in request body.
Fixes #732