Skip to content

fix(spec): correct enum values in validation error example#1641

Open
matanweks wants to merge 1 commit intoa2aproject:mainfrom
matanweks:fix/spec-validation-example-enum-values
Open

fix(spec): correct enum values in validation error example#1641
matanweks wants to merge 1 commit intoa2aproject:mainfrom
matanweks:fix/spec-validation-example-enum-values

Conversation

@matanweks
Copy link

@matanweks matanweks commented Mar 16, 2026

Summary

The validation error example in Section 6.5 has two inconsistencies:

  1. Mismatched error reference: The request sends status=TASK_STATE_RUNNING but the error message references 'running' — updated to reference 'TASK_STATE_RUNNING' to match the actual input
  2. Lowercase enum values in error message: The valid values were listed as pending, working, completed, failed, canceled but Section 5.5 mandates SCREAMING_SNAKE_CASE per the ProtoJSON specification — updated to list all valid TaskState enum values as defined in a2a.proto

Fixes #1642

Test plan

  • Error message now references 'TASK_STATE_RUNNING', matching the request query parameter
  • All 8 valid (non-UNSPECIFIED) TaskState enum values listed in SCREAMING_SNAKE_CASE
  • Enum values verified against a2a.proto lines 187-208
  • Consistent with Section 5.5 (JSON serialization rules) and other spec examples (e.g., line 1494: status=TASK_STATE_WORKING)

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.
@matanweks matanweks requested a review from a team as a code owner March 16, 2026 15:31
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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

  • Corrected Mismatched Error Reference: Updated the validation error example to correctly reference 'TASK_STATE_RUNNING' in the error message, matching the actual input provided in the request.
  • Standardized Enum Values: Adjusted the listed valid enum values in the error message to use SCREAMING_SNAKE_CASE, aligning with Section 5.5 of the ProtoJSON specification and including all 8 valid TaskState enum values.
Changelog
  • docs/specification.md
    • Corrected validation error example for the 'status' field to use accurate enum values and SCREAMING_SNAKE_CASE formatting.
Activity
  • Verified that the error message now correctly references 'TASK_STATE_RUNNING', matching the request query parameter.
  • Confirmed that all 8 valid (non-UNSPECIFIED) TaskState enum values are listed in SCREAMING_SNAKE_CASE.
  • Validated the enum values against the definitions in 'a2a.proto' lines 187-208.
  • Ensured consistency with Section 5.5 (JSON serialization rules) and other specification examples.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 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"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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 error object.
  • This example (and the one in Section 6.4) appears to follow RFC 7807 Problem Details, as indicated by the Content-Type: application/problem+json header.

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.

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]: Validation error example uses non-existent TASK_STATE_RUNNING enum and lowercase enum values

1 participant