[Bug]: JsonFormat parser fails on standard OpenAPI AgentCard (securityRequirements & securitySchemes)
Maintainers usually reply within 1 day
@ashish927 is already working on this.
Since Oct 26, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Reproduce the failure with Protobuf's JsonFormat.parser().merge() using a standard OpenAPI AgentCard payload. Inspect the AgentCard, SecurityRequirement, and SecurityScheme definitions and the ProtoUtils.FromProto.agentCard validation; done means standard securityRequirements and securitySchemes deserialize successfully without manual Jackson AST mutation.
Written by the indexing model from the issue text.
Description
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
- I agree to follow this project's Code of Conduct
- Dominant language
- Java
- Stars
- 514
- Forks
- 200
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 53
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from a2aproject/a2a-java
-
Document 1.x is the actively supported stream, and not 0.3.xPossibly taken @Linux2010 claimed this 2 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
a2aproject/a2a-java#1321 ·
Maintainers usually reply within 1 day
-
HTTP+JSON CancelTask returns 409 Conflict instead of 400 Bad Request for TaskNotCancelableErrorMay be free again @ravismash claimed this 9 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
a2aproject/a2a-java#1298 · 5 comments ·
Maintainers usually reply within 1 day
-
fix: handle blank push notification config id consistently across transportsPossibly taken @prachisinghal-1 claimed this 23 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
a2aproject/a2a-java#1012 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a2aproject/a2a-java#464 · 1 comment ·
Maintainers usually reply within 1 day
-
Create a sample that demonstrates how to use a shared contextId across multiple tasksMay be free again @tanish111 claimed this 390 days ago, and no pull request is open. Opensample
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a2aproject/a2a-java#375 · 5 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in a2aproject/a2a-java
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/skywalking#14239 ·
Maintainers usually reply within 1 day
-
Re-executed query with IN condition on an index column returns deleted rows (stale IndexCursor)Possibly taken @dbusche claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
h2database/h2database#4580 ·
Maintainers usually reply within 1 day
-
vips-drift
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Stirling-Tools/JPDFium#300 ·
Maintainers usually reply within 1 day
-
hermes-queue
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
chrisalunlloyd2-sudo/mindpalace#403 ·
Maintainers usually reply within 1 day
-
Guidelines: document how to build a use case against a local, unpublished Flow/browserless-test changePossibly taken @totally-not-ai claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
vaadin/use-cases#452 · 1 comment ·
Maintainers usually reply within 1 day