fix(spec): correct enum values in validation error example#1641
fix(spec): correct enum values in validation error example#1641matanweks wants to merge 1 commit intoa2aproject:mainfrom
Conversation
The validation error example in Section 6.5 has two issues: 1. The error message references 'running' but the request sends 'TASK_STATE_RUNNING' - the error should reflect what was sent 2. The valid enum values are listed in lowercase (pending, working, ...) but Section 5.5 mandates SCREAMING_SNAKE_CASE per the ProtoJSON specification (TASK_STATE_SUBMITTED, TASK_STATE_WORKING, etc.) Updated the error message to reference 'TASK_STATE_RUNNING' and list all valid TaskState enum values in their canonical SCREAMING_SNAKE_CASE form as defined in a2a.proto.
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 enhances the accuracy and consistency of a validation error example within the specification document. It addresses discrepancies in enum value referencing and formatting, ensuring the example adheres to the ProtoJSON specification and correctly reflects the defined TaskState enum values. This improves the clarity and correctness of the documentation for developers. Highlights
Changelog
Activity
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 two inconsistencies in a validation error example within the specification, aligning the error message with the request and ensuring enum values adhere to the SCREAMING_SNAKE_CASE convention as mandated by the protocol. The change is accurate and improves the documentation's quality. I have added one comment highlighting a broader inconsistency in the specification regarding the format of HTTP error responses, which should be addressed for overall clarity.
| { | ||
| "field": "status", | ||
| "message": "Invalid status value 'running'. Must be one of: pending, working, completed, failed, canceled" | ||
| "message": "Invalid status value 'TASK_STATE_RUNNING'. Must be one of: TASK_STATE_SUBMITTED, TASK_STATE_WORKING, TASK_STATE_COMPLETED, TASK_STATE_FAILED, TASK_STATE_CANCELED, TASK_STATE_INPUT_REQUIRED, TASK_STATE_REJECTED, TASK_STATE_AUTH_REQUIRED" |
There was a problem hiding this comment.
While this change correctly updates the enum values, the overall structure of this error example seems inconsistent with the error handling specification for the HTTP+JSON binding.
- Section 11.6 specifies that HTTP error responses should follow the AIP-193 format, which uses a top-level
errorobject. - This example (and the one in Section 6.4) appears to follow RFC 7807 Problem Details, as indicated by the
Content-Type: application/problem+jsonheader.
This creates a contradiction within the specification. To ensure clarity and consistency for implementers, it would be beneficial to align all HTTP error examples with the single format defined as normative in Section 11.6. This would likely require refactoring this entire error response example in a separate change.
Summary
The validation error example in Section 6.5 has two inconsistencies:
status=TASK_STATE_RUNNINGbut the error message references'running'— updated to reference'TASK_STATE_RUNNING'to match the actual inputpending, working, completed, failed, canceledbut Section 5.5 mandates SCREAMING_SNAKE_CASE per the ProtoJSON specification — updated to list all validTaskStateenum values as defined ina2a.protoFixes #1642
Test plan
'TASK_STATE_RUNNING', matching the request query parametera2a.protolines 187-208status=TASK_STATE_WORKING)