Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions boms/sdk/src/it/sdk-usage-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@
</dependency>

<!-- Third-party dependencies -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package io.a2a.extras.queuemanager.replicated.core;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;
import io.a2a.server.events.EventQueueItem;
import io.a2a.spec.A2AError;
import io.a2a.spec.Event;
Expand All @@ -12,10 +8,8 @@
public class ReplicatedEventQueueItem implements EventQueueItem {
private String taskId;

@JsonInclude(JsonInclude.Include.NON_NULL)
private StreamingEventKind event;

@JsonInclude(JsonInclude.Include.NON_NULL)
private A2AError error;

private boolean closedEvent;
Expand Down Expand Up @@ -71,13 +65,10 @@ public void setTaskId(String taskId) {
* Get the StreamingEventKind event field (for JSON serialization).
* @return the StreamingEventKind event or null
*/
@JsonGetter("event")
@JsonInclude(JsonInclude.Include.NON_NULL)
public StreamingEventKind getStreamingEvent() {
return event;
}

@JsonSetter("event")
public void setEvent(StreamingEventKind event) {
this.event = event;
this.error = null; // Clear error when setting event
Expand All @@ -87,13 +78,10 @@ public void setEvent(StreamingEventKind event) {
* Get the A2AError field (for JSON serialization).
* @return the A2AError or null
*/
@JsonGetter("error")
@JsonInclude(JsonInclude.Include.NON_NULL)
public A2AError getErrorObject() {
return error;
}
Comment on lines 81 to 83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better consistency with Java bean conventions and the corresponding error field and setError() method, consider renaming this getter from getErrorObject() to getError().

Suggested change
public A2AError getErrorObject() {
return error;
}
public A2AError getError() {
return error;
}


@JsonSetter("error")
public void setError(A2AError error) {
this.error = error;
this.event = null; // Clear event when setting error
Expand All @@ -104,7 +92,6 @@ public void setError(A2AError error) {
* This is the method required by the EventQueueItem interface.
* @return the event (StreamingEventKind, A2AError, or QueueClosedEvent) or null if none is set
*/
@JsonIgnore
@Override
public Event getEvent() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The @JsonIgnore annotation was removed from this getEvent() method. This will likely cause it to be included during JSON serialization, which could conflict with the event field that is also serialized. To prevent potential duplicate data or serialization errors, please add the equivalent of @JsonIgnore from the new JSON library.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ehsavoie WDYT? The tests pass

if (closedEvent) {
Expand All @@ -120,7 +107,6 @@ public Event getEvent() {
* Indicates this is a replicated event (implements EventQueueItem).
* @return always true for replicated events
*/
@JsonIgnore
@Override
public boolean isReplicated() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

With the removal of @JsonIgnore, this isReplicated() method will likely be serialized, adding a potentially unnecessary "replicated": true field to the JSON output. To maintain the previous behavior, please add the equivalent 'ignore' annotation from the new JSON library.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ehsavoie WDYT? The tests pass

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that gson uses fields, not getter and setter for serialization

return true;
Expand All @@ -147,7 +133,6 @@ public boolean hasError() {
* For JSON serialization.
* @return true if this is a queue closed event
*/
@JsonGetter("closedEvent")
public boolean isClosedEvent() {
return closedEvent;
}
Expand All @@ -156,7 +141,6 @@ public boolean isClosedEvent() {
* Set the closed event flag (for JSON deserialization).
* @param closedEvent true if this is a queue closed event
*/
@JsonSetter("closedEvent")
public void setClosedEvent(boolean closedEvent) {
this.closedEvent = closedEvent;
if (closedEvent) {
Expand Down
8 changes: 0 additions & 8 deletions server-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-client-transport-jsonrpc</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny-zero</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions transport/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
Expand Down