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
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public class JsonMessages {
"error": {
"code": -32702,
"message": "Invalid parameters",
"details": {"info": "Hello world"}
"data": {"info": "Hello world"}
}
}""";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class JsonStreamingMessages {
"error": {
"code": -32602,
"message": "Invalid parameters",
"details": {"info": "Missing required field"}
"data": {"info": "Missing required field"}
}
}""";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ private static A2AError processError(JsonObject error) {
String message = error.has("message") ? error.get("message").getAsString() : null;
Integer code = error.has("code") ? error.get("code").getAsInt() : null;
Map<String, Object> details = null;
if (error.has("details") && error.get("details").isJsonObject()) {
details =GSON.fromJson(error.get("details"), Map.class);
if (error.has("data") && error.get("data").isJsonObject()) {
details =GSON.fromJson(error.get("data"), Map.class);
}
if (code != null) {
A2AErrorCodes errorCode = A2AErrorCodes.fromCode(code);
Expand Down Expand Up @@ -606,7 +606,7 @@ public static String toJsonRPCErrorResponse(Object requestId, A2AError error) {
output.name("code").value(error.getCode());
output.name("message").value(error.getMessage());
if (!error.getDetails().isEmpty()) {
output.name("details");
output.name("data");
GSON.toJson(error.getDetails(), Map.class, output);
}
output.endObject();
Expand Down
Loading