What happened?
When deserializing an OpenAPI-compliant AgentCard JSON payload into org.a2aproject.sdk.grpc.AgentCard using Protobuf's JsonFormat.parser().merge(), two schema mismatch errors occur because the Protobuf definitions expect custom nested message structures instead of standard OpenAPI JSON structures.
Bug 1: securityRequirements Array Mismatch
Issue: OpenAPI specs define security requirements as "bearerAuth": []. In a2a.proto, SecurityRequirement maps schemes as map<string, StringList>, expecting a nested StringList message ({"bearerAuth": {"list": []}}).
Error: com.google.protobuf.InvalidProtocolBufferException: Expect message object but got: [].
Bug 2: securitySchemes Flattened Structure Mismatch
Issue: OpenAPI specs define security scheme parameters at the root level ("scheme": "bearer", "bearerFormat": "API Key"). Protobuf expects these wrapped inside the oneof field http ("http": {"scheme": "bearer", ...}).
Error: InvalidParamsError: SecurityScheme oneof field not set during ProtoUtils.FromProto.agentCard(builder) validation.
Expected Behavior
The SDK should provide an adapter or custom JSON deserializer capable of parsing standard OpenAPI Agent Cards without requiring clients to manually mutate Jackson AST nodes before Protobuf merging.
Environment
SDK Version: Protobuf Java 4.33.1 / SDK org.a2aproject.sdk.grpc
Relevant log output
Code of Conduct
What happened?
When deserializing an OpenAPI-compliant AgentCard JSON payload into org.a2aproject.sdk.grpc.AgentCard using Protobuf's JsonFormat.parser().merge(), two schema mismatch errors occur because the Protobuf definitions expect custom nested message structures instead of standard OpenAPI JSON structures.
Bug 1: securityRequirements Array Mismatch
Issue: OpenAPI specs define security requirements as "bearerAuth": []. In a2a.proto, SecurityRequirement maps schemes as map<string, StringList>, expecting a nested StringList message ({"bearerAuth": {"list": []}}).
Error: com.google.protobuf.InvalidProtocolBufferException: Expect message object but got: [].
Bug 2: securitySchemes Flattened Structure Mismatch
Issue: OpenAPI specs define security scheme parameters at the root level ("scheme": "bearer", "bearerFormat": "API Key"). Protobuf expects these wrapped inside the oneof field http ("http": {"scheme": "bearer", ...}).
Error: InvalidParamsError: SecurityScheme oneof field not set during ProtoUtils.FromProto.agentCard(builder) validation.
Expected Behavior
The SDK should provide an adapter or custom JSON deserializer capable of parsing standard OpenAPI Agent Cards without requiring clients to manually mutate Jackson AST nodes before Protobuf merging.
Environment
SDK Version: Protobuf Java 4.33.1 / SDK org.a2aproject.sdk.grpc
Relevant log output
Code of Conduct