Skip to content

Comments

fix: flow representation#219

Merged
yarolegovich merged 1 commit intospec-v1/type-updatefrom
yarolegovich/fix-flows-json
Feb 18, 2026
Merged

fix: flow representation#219
yarolegovich merged 1 commit intospec-v1/type-updatefrom
yarolegovich/fix-flows-json

Conversation

@yarolegovich
Copy link
Member

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yarolegovich, 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 streamlines the internal representation of OAuth2 flows within the OAuth2SecurityScheme by moving from a map of named flows to a direct embedding of a single flow. This change simplifies the data structure and its associated JSON serialization and deserialization logic, making the OAuth2SecurityScheme more straightforward to use and manage.

Highlights

  • Refactored OAuth2 Flow Representation: The OAuth2SecurityScheme structure was updated to directly hold a single OAuthFlows interface instead of a NamedOAuthFlows map, simplifying the representation of OAuth2 flows.
  • Removed NamedOAuthFlows Type: The NamedOAuthFlows type, which previously wrapped multiple OAuth flows, has been removed as part of the simplification.
  • Updated JSON Marshaling/Unmarshaling: Custom MarshalJSON and UnmarshalJSON methods for OAuth2SecurityScheme were rewritten to correctly handle the new single-flow structure, ensuring proper serialization and deserialization.
  • Renamed Interface Method: The internal interface method isOAuthFlows_Flow() was renamed to isOAuthFlow() for consistency.
  • Adjusted Test Cases: Existing test cases in json_test.go were modified to reflect the updated structure of OAuth2SecurityScheme and its OAuth flows.
Changelog
  • a2a/auth.go
    • Changed the type of the Flows field in OAuth2SecurityScheme from NamedOAuthFlows to OAuthFlows.
    • Removed the NamedOAuthFlows type definition.
    • Rewrote the MarshalJSON method for OAuth2SecurityScheme to serialize a single OAuth flow.
    • Rewrote the UnmarshalJSON method for OAuth2SecurityScheme to deserialize a single OAuth flow and enforce that exactly one flow is present.
    • Renamed the isOAuthFlows_Flow() method to isOAuthFlow().
  • a2a/json_test.go
    • Updated the TestSecuritySchemeJSONCodec test case to reflect the new single-flow structure for OAuth2SecurityScheme, removing the NamedOAuthFlows wrapper and the flow name in the expected JSON output.
Activity
  • No human activity has been recorded on this pull request yet.
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 refactors the representation of OAuth 2.0 flows within the OAuth2SecurityScheme by changing the Flows field from NamedOAuthFlows to OAuthFlows. This modification simplifies the structure to enforce that each OAuth2SecurityScheme now contains exactly one OAuth flow, rather than a map of potentially multiple named flows. The custom MarshalJSON and UnmarshalJSON methods for OAuth2SecurityScheme have been updated to reflect this new single-flow structure, including a validation check in UnmarshalJSON to ensure only one flow is present. The test file a2a/json_test.go has also been updated to align with these changes, ensuring proper serialization and deserialization of the new flow representation.

@yarolegovich yarolegovich merged commit dd48d37 into spec-v1/type-update Feb 18, 2026
2 checks passed
@yarolegovich yarolegovich deleted the yarolegovich/fix-flows-json branch February 18, 2026 09:37
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