refactor: use @Nullable String for tenant across all spec params records#910
refactor: use @Nullable String for tenant across all spec params records#910ehsavoie wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the handling of the tenant field across various SDK specification classes, builders, and MapStruct mappers to support nullable tenants instead of using empty strings as defaults. It removes non-null assertions for the tenant parameter and updates the utility method extractTenant to accept a nullable agent tenant. Feedback suggests ensuring that the fallback agentTenant is also normalized and validated in extractTenant to prevent malformed URLs.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
The tenant field was semantically optional but typed as non-nullable String with "" as an absent-value sentinel in most params records, while GetExtendedAgentCardParams and TaskPushNotificationConfig correctly used @nullable String. This standardizes all params records to @nullable (null = no tenant), removes the Assert.checkNotNullParam assertions for tenant, and updates gRPC MapStruct mappers to skip setTenant when null (conditionExpression) and convert proto "" back to null on fromProto (emptyToNull). Fixes a2aproject#844 Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
The tenant field was semantically optional but typed as non-nullable String with "" as an absent-value sentinel in most params records, while GetExtendedAgentCardParams and TaskPushNotificationConfig correctly used @nullable String. This standardizes all params records to @nullable (null = no tenant), removes the Assert.checkNotNullParam assertions for tenant, and updates gRPC MapStruct mappers to skip setTenant when null (conditionExpression) and convert proto "" back to null on fromProto (emptyToNull).
Fixes #844 🦕