From 2c4a2c243b1c46c27c543cb11a8f4bd34eab53ba Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Thu, 24 Oct 2024 17:12:04 +0200 Subject: [PATCH] ActionOutput: Document QR code rendering & Fix action REST doc Signed-off-by: Florian Hotze --- .../rest/internal/ThingActionsResource.java | 2 +- .../automation/annotation/ActionOutput.java | 20 +++++++++++++++++++ 2 files changed, 21 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 16f8c92a719..4dba80b5b46 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 @@ -149,7 +149,7 @@ protected void removeModuleHandlerFactory(ModuleHandlerFactory moduleHandlerFact @Produces(MediaType.APPLICATION_JSON) @Operation(operationId = "getAvailableActionsForThing", summary = "Get all available actions for provided thing UID", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ThingActionDTO.class), uniqueItems = true))), - @ApiResponse(responseCode = "204", description = "No actions found.") }) + @ApiResponse(responseCode = "404", description = "No actions found.") }) public Response getActions(@PathParam("thingUID") @Parameter(description = "thingUID") String thingUID, @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language) { Locale locale = localeService.getLocale(language); diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/annotation/ActionOutput.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/annotation/ActionOutput.java index 0859602a2fd..c2d212de80a 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/annotation/ActionOutput.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/annotation/ActionOutput.java @@ -29,8 +29,28 @@ @Target(ElementType.METHOD) public @interface ActionOutput { + /** + * Name of the output parameter + *

+ * There are some reserved names that make the UI render the output pretty and not just as a text field: + *

+ * + * @return the name of the output parameter + */ String name(); + /** + * Type of the output parameter + *

+ * There are some special types that make the UI render the output pretty and not just as a text field: + *

+ * + * @return the type of the output parameter + */ String type(); String label() default "";