Class A2aServerJson
Why not the host's Jackson mapper. The A2A spec types are not plain data. Several are
discriminated by member name rather than by a type tag, and the SDK implements that
with Gson type adapters registered inside JsonUtil: a Part is written as exactly
one of text / raw / url / data, and a SendMessageResponse
result as exactly one of task / message. Jackson sees ordinary Java records and
writes every member, producing JSON that round-trips locally and that a spec-compliant client
cannot discriminate. The sibling implementation in dai-release-assistant shipped exactly that
bug before switching to the SDK mapper, so this is a known failure mode and not a precaution.
The cost is a second JSON library inside this module — Gson, already a transitive dependency
of the spec jar. It stays confined here: nothing outside com.xebialabs.xlrelease.a2a
sees an SDK type, and the OSGi-exported surface is still the plain view types.
-
Method Summary
-
Method Details
-
write
Serializes an A2A payload through the SDK's mapper.- Parameters:
payload- the spec type to serialize- Returns:
- its JSON representation
-