Skip to content

Commit 209d610

Browse files
committed
fix: Update a2a.proto changes
Aligning to the latest version of a2a.proto Update tests to match a2a.proto changes: Fixes test failures after proto update - adjusts JSON structures and package references to align with new proto definitions. Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
1 parent b32e8c7 commit 209d610

124 files changed

Lines changed: 4763 additions & 4628 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎client/transport/grpc/src/main/java/io/a2a/client/transport/grpc/GrpcTransport.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ public TaskPushNotificationConfig createTaskPushNotificationConfiguration(TaskPu
237237
io.a2a.grpc.CreateTaskPushNotificationConfigRequest grpcRequest = io.a2a.grpc.CreateTaskPushNotificationConfigRequest.newBuilder()
238238
.setTaskId(request.taskId())
239239
.setConfig(ToProto.taskPushNotificationConfig(request).getPushNotificationConfig())
240-
.setConfigId(configId != null ? configId : request.taskId())
241240
.setTenant(resolveTenant(request.tenant()))
242241
.build();
243242
PayloadAndHeaders payloadAndHeaders = applyInterceptors(SET_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, grpcRequest, agentCard, context);
@@ -280,7 +279,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
280279
@Nullable ClientCallContext context) throws A2AClientException {
281280
checkNotNullParam("request", request);
282281

283-
io.a2a.grpc.ListTaskPushNotificationConfigRequest grpcRequest = io.a2a.grpc.ListTaskPushNotificationConfigRequest.newBuilder()
282+
io.a2a.grpc.ListTaskPushNotificationConfigsRequest grpcRequest = io.a2a.grpc.ListTaskPushNotificationConfigsRequest.newBuilder()
284283
.setTaskId(request.id())
285284
.setTenant(resolveTenant(request.tenant()))
286285
.setPageSize(request.pageSize())
@@ -291,7 +290,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
291290

292291
try {
293292
A2AServiceBlockingV2Stub stubWithMetadata = createBlockingStubWithMetadata(context, payloadAndHeaders);
294-
io.a2a.grpc.ListTaskPushNotificationConfigResponse grpcResponse = stubWithMetadata.listTaskPushNotificationConfig(grpcRequest);
293+
io.a2a.grpc.ListTaskPushNotificationConfigsResponse grpcResponse = stubWithMetadata.listTaskPushNotificationConfigs(grpcRequest);
295294
return FromProto.listTaskPushNotificationConfigResult(grpcResponse);
296295
} catch (StatusRuntimeException | StatusException e) {
297296
throw GrpcErrorMapper.mapGrpcError(e, "Failed to list task push notification config: ");

‎client/transport/jsonrpc/src/main/java/io/a2a/client/transport/jsonrpc/JSONRPCTransport.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import io.a2a.jsonrpc.common.wrappers.GetExtendedAgentCardResponse;
4040
import io.a2a.jsonrpc.common.wrappers.GetTaskPushNotificationConfigResponse;
4141
import io.a2a.jsonrpc.common.wrappers.GetTaskResponse;
42-
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigResponse;
42+
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigsResponse;
4343
import io.a2a.jsonrpc.common.wrappers.ListTasksResponse;
4444
import io.a2a.jsonrpc.common.wrappers.ListTasksResult;
4545
import io.a2a.jsonrpc.common.wrappers.SendMessageResponse;
@@ -227,7 +227,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
227227

228228
try {
229229
String httpResponseBody = sendPostRequest(Utils.buildBaseUrl(agentInterface, request.tenant()), payloadAndHeaders, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
230-
ListTaskPushNotificationConfigResponse response = unmarshalResponse(httpResponseBody, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
230+
ListTaskPushNotificationConfigsResponse response = unmarshalResponse(httpResponseBody, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
231231
return response.getResult();
232232
} catch (A2AClientException e) {
233233
throw e;

‎client/transport/jsonrpc/src/test/java/io/a2a/client/transport/jsonrpc/JsonMessages.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ public class JsonMessages {
322322
"id": "cd4c76de-d54c-436c-8b9f-4c2703648d64",
323323
"result": {
324324
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
325-
"id": "c295ea44-7543-4f78-b524-7a38915ad6e4",
326325
"pushNotificationConfig": {
326+
"id": "c295ea44-7543-4f78-b524-7a38915ad6e4",
327327
"url": "https://example.com/callback",
328328
"authentication": {
329329
"scheme": "jwt"
@@ -339,8 +339,8 @@ public class JsonMessages {
339339
"method":"CreateTaskPushNotificationConfig",
340340
"params":{
341341
"taskId":"de38c76d-d54c-436c-8b9f-4c2703648d64",
342-
"configId":"c295ea44-7543-4f78-b524-7a38915ad6e4",
343342
"config":{
343+
"id":"c295ea44-7543-4f78-b524-7a38915ad6e4",
344344
"url":"https://example.com/callback",
345345
"authentication":{
346346
"scheme":"jwt"
@@ -355,8 +355,8 @@ public class JsonMessages {
355355
"id": "cd4c76de-d54c-436c-8b9f-4c2703648d64",
356356
"result": {
357357
"taskId":"de38c76d-d54c-436c-8b9f-4c2703648d64",
358-
"id":"c295ea44-7543-4f78-b524-7a38915ad6e4",
359358
"pushNotificationConfig": {
359+
"id":"c295ea44-7543-4f78-b524-7a38915ad6e4",
360360
"url": "https://example.com/callback",
361361
"authentication": {
362362
"scheme": "jwt"

‎client/transport/rest/src/main/java/io/a2a/client/transport/rest/RestTransport.java‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ public TaskPushNotificationConfig createTaskPushNotificationConfiguration(TaskPu
274274
= io.a2a.grpc.CreateTaskPushNotificationConfigRequest.newBuilder();
275275
builder.setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(request).getPushNotificationConfig())
276276
.setTaskId(request.taskId());
277-
if (request.config().id() != null) {
278-
builder.setConfigId(request.config().id());
279-
}
280277
PayloadAndHeaders payloadAndHeaders = applyInterceptors(SET_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, builder, agentCard, context);
281278
try {
282279
String httpResponseBody = sendPostRequest(Utils.buildBaseUrl(agentInterface, request.tenant()) + String.format("/tasks/%1s/pushNotificationConfigs", request.taskId()), payloadAndHeaders);
@@ -332,8 +329,8 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPu
332329
@Override
333330
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws A2AClientException {
334331
checkNotNullParam("request", request);
335-
io.a2a.grpc.ListTaskPushNotificationConfigRequest.Builder builder
336-
= io.a2a.grpc.ListTaskPushNotificationConfigRequest.newBuilder();
332+
io.a2a.grpc.ListTaskPushNotificationConfigsRequest.Builder builder
333+
= io.a2a.grpc.ListTaskPushNotificationConfigsRequest.newBuilder();
337334
builder.setTaskId(request.id());
338335
PayloadAndHeaders payloadAndHeaders = applyInterceptors(LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, builder,
339336
agentCard, context);
@@ -350,7 +347,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
350347
throw RestErrorMapper.mapRestError(response);
351348
}
352349
String httpResponseBody = response.body();
353-
io.a2a.grpc.ListTaskPushNotificationConfigResponse.Builder responseBuilder = io.a2a.grpc.ListTaskPushNotificationConfigResponse.newBuilder();
350+
io.a2a.grpc.ListTaskPushNotificationConfigsResponse.Builder responseBuilder = io.a2a.grpc.ListTaskPushNotificationConfigsResponse.newBuilder();
354351
JsonFormat.parser().merge(httpResponseBody, responseBuilder);
355352
return ProtoUtils.FromProto.listTaskPushNotificationConfigResult(responseBuilder);
356353
} catch (A2AClientException e) {

‎client/transport/rest/src/test/java/io/a2a/client/transport/rest/JsonRestMessages.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ public class JsonRestMessages {
308308
static final String GET_TASK_PUSH_NOTIFICATION_CONFIG_TEST_RESPONSE = """
309309
{
310310
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
311-
"id": "10",
312311
"pushNotificationConfig": {
312+
"id": "10",
313313
"url": "https://example.com/callback",
314314
"authentication": {
315315
"scheme": "jwt"
@@ -321,8 +321,8 @@ public class JsonRestMessages {
321321
"configs":[
322322
{
323323
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
324-
"id": "10",
325324
"pushNotificationConfig": {
325+
"id": "10",
326326
"url": "https://example.com/callback",
327327
"authentication": {
328328
"scheme": "jwt"
@@ -331,8 +331,8 @@ public class JsonRestMessages {
331331
},
332332
{
333333
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
334-
"id": "5",
335334
"pushNotificationConfig": {
335+
"id": "5",
336336
"url": "https://test.com/callback"
337337
}
338338
}
@@ -343,8 +343,8 @@ public class JsonRestMessages {
343343
static final String SET_TASK_PUSH_NOTIFICATION_CONFIG_TEST_REQUEST = """
344344
{
345345
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
346-
"configId": "default-config-id",
347346
"config": {
347+
"id": "default-config-id",
348348
"url": "https://example.com/callback",
349349
"authentication": {
350350
"scheme": "jwt"
@@ -355,8 +355,8 @@ public class JsonRestMessages {
355355
static final String SET_TASK_PUSH_NOTIFICATION_CONFIG_TEST_RESPONSE = """
356356
{
357357
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
358-
"id": "10",
359358
"pushNotificationConfig": {
359+
"id": "10",
360360
"url": "https://example.com/callback",
361361
"authentication": {
362362
"scheme": "jwt"

‎jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/A2AResponse.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @param <T> the type of the result value returned in successful responses
1212
*/
13-
public abstract sealed class A2AResponse<T> implements A2AMessage permits CancelTaskResponse, DeleteTaskPushNotificationConfigResponse, GetExtendedAgentCardResponse, GetTaskPushNotificationConfigResponse, GetTaskResponse, A2AErrorResponse, ListTaskPushNotificationConfigResponse, ListTasksResponse, SendMessageResponse, SendStreamingMessageResponse, CreateTaskPushNotificationConfigResponse {
13+
public abstract sealed class A2AResponse<T> implements A2AMessage permits CancelTaskResponse, DeleteTaskPushNotificationConfigResponse, GetExtendedAgentCardResponse, GetTaskPushNotificationConfigResponse, GetTaskResponse, A2AErrorResponse, ListTaskPushNotificationConfigsResponse, ListTasksResponse, SendMessageResponse, SendStreamingMessageResponse, CreateTaskPushNotificationConfigResponse {
1414

1515
/** The JSON-RPC protocol version. */
1616
protected String jsonrpc;

jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/ListTaskPushNotificationConfigRequest.java renamed to jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/ListTaskPushNotificationConfigsRequest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @see TaskPushNotificationConfig for the configuration structure
2222
* @see <a href="https://a2a-protocol.org/latest/">A2A Protocol Specification</a>
2323
*/
24-
public final class ListTaskPushNotificationConfigRequest extends NonStreamingJSONRPCRequest<ListTaskPushNotificationConfigParams> {
24+
public final class ListTaskPushNotificationConfigsRequest extends NonStreamingJSONRPCRequest<ListTaskPushNotificationConfigParams> {
2525

2626
/**
2727
* Constructs request with all parameters.
@@ -30,7 +30,7 @@ public final class ListTaskPushNotificationConfigRequest extends NonStreamingJSO
3030
* @param id the request ID
3131
* @param params the request parameters
3232
*/
33-
public ListTaskPushNotificationConfigRequest(String jsonrpc, Object id, ListTaskPushNotificationConfigParams params) {
33+
public ListTaskPushNotificationConfigsRequest(String jsonrpc, Object id, ListTaskPushNotificationConfigParams params) {
3434
super(jsonrpc, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, id, params);
3535
}
3636

@@ -40,7 +40,7 @@ public ListTaskPushNotificationConfigRequest(String jsonrpc, Object id, ListTask
4040
* @param id the request ID
4141
* @param params the request parameters
4242
*/
43-
public ListTaskPushNotificationConfigRequest(String id, ListTaskPushNotificationConfigParams params) {
43+
public ListTaskPushNotificationConfigsRequest(String id, ListTaskPushNotificationConfigParams params) {
4444
this(null, id, params);
4545
}
4646

@@ -105,11 +105,11 @@ public Builder params(ListTaskPushNotificationConfigParams params) {
105105
*
106106
* @return a new instance
107107
*/
108-
public ListTaskPushNotificationConfigRequest build() {
108+
public ListTaskPushNotificationConfigsRequest build() {
109109
if (id == null) {
110110
id = UUID.randomUUID().toString();
111111
}
112-
return new ListTaskPushNotificationConfigRequest(jsonrpc, id, params);
112+
return new ListTaskPushNotificationConfigsRequest(jsonrpc, id, params);
113113
}
114114
}
115115
}

jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/ListTaskPushNotificationConfigResponse.java renamed to jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/ListTaskPushNotificationConfigsResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @see TaskPushNotificationConfig for the configuration structure
1919
* @see <a href="https://a2a-protocol.org/latest/">A2A Protocol Specification</a>
2020
*/
21-
public final class ListTaskPushNotificationConfigResponse extends A2AResponse<ListTaskPushNotificationConfigResult> {
21+
public final class ListTaskPushNotificationConfigsResponse extends A2AResponse<ListTaskPushNotificationConfigResult> {
2222

2323
/**
2424
* Constructs response with all parameters.
@@ -28,7 +28,7 @@ public final class ListTaskPushNotificationConfigResponse extends A2AResponse<Li
2828
* @param result the result containing list of push notification configurations and pagination info
2929
* @param error the error (if any)
3030
*/
31-
public ListTaskPushNotificationConfigResponse(String jsonrpc, Object id, ListTaskPushNotificationConfigResult result, A2AError error) {
31+
public ListTaskPushNotificationConfigsResponse(String jsonrpc, Object id, ListTaskPushNotificationConfigResult result, A2AError error) {
3232
super(jsonrpc, id, result, error, ListTaskPushNotificationConfigResult.class);
3333
}
3434

@@ -38,7 +38,7 @@ public ListTaskPushNotificationConfigResponse(String jsonrpc, Object id, ListTas
3838
* @param id the request ID
3939
* @param error the error
4040
*/
41-
public ListTaskPushNotificationConfigResponse(Object id, A2AError error) {
41+
public ListTaskPushNotificationConfigsResponse(Object id, A2AError error) {
4242
this(null, id, null, error);
4343
}
4444

@@ -48,7 +48,7 @@ public ListTaskPushNotificationConfigResponse(Object id, A2AError error) {
4848
* @param id the request ID
4949
* @param result the result containing list of push notification configurations and pagination info
5050
*/
51-
public ListTaskPushNotificationConfigResponse(Object id, ListTaskPushNotificationConfigResult result) {
51+
public ListTaskPushNotificationConfigsResponse(Object id, ListTaskPushNotificationConfigResult result) {
5252
this(null, id, result, null);
5353
}
5454

‎jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/NonStreamingJSONRPCRequest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
public abstract sealed class NonStreamingJSONRPCRequest<T> extends A2ARequest<T> permits GetTaskRequest,
99
CancelTaskRequest, CreateTaskPushNotificationConfigRequest, GetTaskPushNotificationConfigRequest,
10-
SendMessageRequest, DeleteTaskPushNotificationConfigRequest, ListTaskPushNotificationConfigRequest,
10+
SendMessageRequest, DeleteTaskPushNotificationConfigRequest, ListTaskPushNotificationConfigsRequest,
1111
GetExtendedAgentCardRequest, ListTasksRequest {
1212

1313
NonStreamingJSONRPCRequest(String jsonrpc, String method, Object id, T params) {

‎reference/jsonrpc/src/main/java/io/a2a/server/apps/quarkus/A2AServerRoutes.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
import io.a2a.jsonrpc.common.wrappers.GetTaskPushNotificationConfigResponse;
4444
import io.a2a.jsonrpc.common.wrappers.GetTaskRequest;
4545
import io.a2a.jsonrpc.common.wrappers.GetTaskResponse;
46-
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigRequest;
47-
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigResponse;
46+
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigsRequest;
47+
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigsResponse;
4848
import io.a2a.jsonrpc.common.wrappers.ListTasksRequest;
4949
import io.a2a.jsonrpc.common.wrappers.ListTasksResponse;
5050
import io.a2a.jsonrpc.common.wrappers.NonStreamingJSONRPCRequest;
@@ -187,7 +187,7 @@ private A2AResponse<?> processNonStreamingRequest(NonStreamingJSONRPCRequest<?>
187187
if (request instanceof SendMessageRequest req) {
188188
return jsonRpcHandler.onMessageSend(req, context);
189189
}
190-
if (request instanceof ListTaskPushNotificationConfigRequest req) {
190+
if (request instanceof ListTaskPushNotificationConfigsRequest req) {
191191
return jsonRpcHandler.listPushNotificationConfig(req, context);
192192
}
193193
if (request instanceof DeleteTaskPushNotificationConfigRequest req) {
@@ -304,7 +304,7 @@ private static com.google.protobuf.MessageOrBuilder convertToProto(A2AResponse<?
304304
return io.a2a.grpc.utils.ProtoUtils.ToProto.createTaskPushNotificationConfigResponse(r.getResult());
305305
} else if (response instanceof GetTaskPushNotificationConfigResponse r) {
306306
return io.a2a.grpc.utils.ProtoUtils.ToProto.getTaskPushNotificationConfigResponse(r.getResult());
307-
} else if (response instanceof ListTaskPushNotificationConfigResponse r) {
307+
} else if (response instanceof ListTaskPushNotificationConfigsResponse r) {
308308
return io.a2a.grpc.utils.ProtoUtils.ToProto.listTaskPushNotificationConfigResponse(r.getResult());
309309
} else if (response instanceof DeleteTaskPushNotificationConfigResponse) {
310310
// DeleteTaskPushNotificationConfig has no result body, just return empty message

0 commit comments

Comments
 (0)