Skip to content

Commit 8c3bd79

Browse files
committed
FIxing regexp
Signed-off-by: Emmanuel Hugonnet <[email protected]>
1 parent 45e7d33 commit 8c3bd79

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

reference/rest/src/main/java/io/a2a/server/rest/quarkus/A2AServerRoutes.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ public void listTasks(RoutingContext rc) {
160160
}
161161
}
162162

163-
@Route(regex = "^\\/(?<tenant>[^\\/]*\\/?)tasks\\/(?<id>[^:]+)", order = 1, methods = {Route.HttpMethod.GET}, type = Route.HandlerType.BLOCKING)
163+
@Route(regex = "^\\/(?<tenant>[^\\/]*\\/?)tasks\\/(?<taskId>[^:]+)!\\/pushNotificationConfigs", order = 1, methods = {Route.HttpMethod.GET}, type = Route.HandlerType.BLOCKING)
164164
public void getTask(RoutingContext rc) {
165-
String taskId = rc.pathParam("id");
165+
String taskId = rc.pathParam("taskId");
166166
ServerCallContext context = createCallContext(rc, GetTaskRequest.METHOD);
167167
HTTPRestResponse response = null;
168168
try {
@@ -265,9 +265,9 @@ public void setTaskPushNotificationConfiguration(@Body String body, RoutingConte
265265
}
266266
}
267267

268-
@Route(regex = "^\\/(?<tenant>[^\\/]*\\/?)tasks\\/(?<id>[^/]+)\\/pushNotificationConfigs\\/(?<configId>[^\\/]+)", order = 2, methods = {Route.HttpMethod.GET}, type = Route.HandlerType.BLOCKING)
268+
@Route(regex = "^\\/(?<tenant>[^\\/]*\\/?)tasks\\/(?<taskId>[^/]+)\\/pushNotificationConfigs\\/(?<configId>[^\\/]+)", order = 2, methods = {Route.HttpMethod.GET}, type = Route.HandlerType.BLOCKING)
269269
public void getTaskPushNotificationConfiguration(RoutingContext rc) {
270-
String taskId = rc.pathParam("id");
270+
String taskId = rc.pathParam("taskId");
271271
String configId = rc.pathParam("configId");
272272
ServerCallContext context = createCallContext(rc, GetTaskPushNotificationConfigRequest.METHOD);
273273
HTTPRestResponse response = null;
@@ -284,7 +284,7 @@ public void getTaskPushNotificationConfiguration(RoutingContext rc) {
284284
}
285285
}
286286

287-
@Route(regex = "^\\/(?<tenant>[^\\/]*\\/?)tasks\\/(?<id>[^/]+)\\/pushNotificationConfigs\\/$", order = 1, methods = {Route.HttpMethod.GET}, type = Route.HandlerType.BLOCKING)
287+
@Route(regex = "^\\/(?<tenant>[^\\/]*\\/?)tasks\\/(?<taskId>[^/]+)\\/pushNotificationConfigs\\/$", order = 1, methods = {Route.HttpMethod.GET}, type = Route.HandlerType.BLOCKING)
288288
public void getTaskPushNotificationConfigurationWithoutId(RoutingContext rc) {
289289
String taskId = rc.pathParam("id");
290290
ServerCallContext context = createCallContext(rc, GetTaskPushNotificationConfigRequest.METHOD);

reference/rest/src/test/java/io/a2a/server/rest/quarkus/A2AServerRoutesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void testSendMessageStreaming_MethodNameSetInContext() {
133133
@Test
134134
public void testGetTask_MethodNameSetInContext() {
135135
// Arrange
136-
when(mockRoutingContext.pathParam("id")).thenReturn("task123");
136+
when(mockRoutingContext.pathParam("taskId")).thenReturn("task123");
137137
HTTPRestResponse mockHttpResponse = mock(HTTPRestResponse.class);
138138
when(mockHttpResponse.getStatusCode()).thenReturn(200);
139139
when(mockHttpResponse.getContentType()).thenReturn("application/json");
@@ -223,7 +223,7 @@ public void testSetTaskPushNotificationConfiguration_MethodNameSetInContext() {
223223
@Test
224224
public void testGetTaskPushNotificationConfiguration_MethodNameSetInContext() {
225225
// Arrange
226-
when(mockRoutingContext.pathParam("id")).thenReturn("task123");
226+
when(mockRoutingContext.pathParam("taskId")).thenReturn("task123");
227227
when(mockRoutingContext.pathParam("configId")).thenReturn("config456");
228228
HTTPRestResponse mockHttpResponse = mock(HTTPRestResponse.class);
229229
when(mockHttpResponse.getStatusCode()).thenReturn(200);

0 commit comments

Comments
 (0)