-
Notifications
You must be signed in to change notification settings - Fork 104
fix: Remove remaining jackson dependencies/imports #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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; | ||
|
|
@@ -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; | ||
|
|
@@ -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 | ||
|
|
@@ -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; | ||
| } | ||
|
|
||
| @JsonSetter("error") | ||
| public void setError(A2AError error) { | ||
| this.error = error; | ||
| this.event = null; // Clear event when setting error | ||
|
|
@@ -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() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ehsavoie WDYT? The tests pass |
||
| if (closedEvent) { | ||
|
|
@@ -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() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ehsavoie WDYT? The tests pass
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
|
@@ -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; | ||
| } | ||
|
|
@@ -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) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better consistency with Java bean conventions and the corresponding
errorfield andsetError()method, consider renaming this getter fromgetErrorObject()togetError().