From 31d3434893a2319ef1136c6e8263fa6fa111d1f3 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Mon, 11 Nov 2024 09:13:25 +0100 Subject: [PATCH] [rest] Fix ThingActionsResource does not accept new Thing action UIDs with hash (#4445) * [rest] Fix ThingActionsResource does not accept new Thing action UIDs due to wrong path RegEx Signed-off-by: Florian Hotze --- .../core/automation/rest/internal/ThingActionsResource.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java b/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java index 40c25278bc3..c7c4b009acf 100644 --- a/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java +++ b/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java @@ -217,7 +217,9 @@ public Response getActions(@PathParam("thingUID") @Parameter(description = "thin @POST @RolesAllowed({ Role.USER, Role.ADMIN }) - @Path("/{thingUID}/{actionUid: [a-zA-Z0-9]+\\.[a-zA-Z0-9]+}") + // accept actionUid in the form of "scope.actionTypeUid" or "scope.actionTypeUid#signatureHash" + // # is URL encoded as %23 + @Path("/{thingUID}/{actionUid: [a-zA-Z0-9]+\\.[a-zA-Z0-9]+(%23[A-Fa-f0-9]+)?}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(operationId = "executeThingAction", summary = "Executes a thing action.", responses = {