[Bug]: v1.0和v0.3相互转换时,如果parts中的metadata中的值为null,会抛NPE异常

Open Beginner friendly
#1,275 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
api

Research direction

The NPE is reported in TextPart_v0_3 and DataPart_v0_3 in the org.a2aproject.sdk.compat03.spec package, during conversion between v1.0 and v0.3 parts. Start with those two classes and find where their metadata map is read or copied during conversion. Confirm the null-value case with a round-trip conversion of a part whose metadata contains a null value. Done when both directions convert such parts without an exception and the null values are preserved.

Written by the indexing model from the issue text.

Description

What happened?

org.a2aproject.sdk.compat03.spec.TextPart_v0_3 类中。
v1.0和v0.3相互转换时,如果parts中的metadata中的值为null,会抛NPE异常.实际上A2A协议中可以允许medata的value为空.

Image

同样的,在org.a2aproject.sdk.compat03.spec.DataPart_v0_3中也有这个问题.
Image

Relevant log output

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
Java
Stars
510
Forks
196
Avg merge
2d 9h
Merged PRs (30d)
50

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from a2aproject/a2a-java

All issues in a2aproject/a2a-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.