ActionOutput: Document QR code rendering & Fix action REST doc (#4421)

Signed-off-by: Florian Hotze <dev@florianhotze.com>
This commit is contained in:
Florian Hotze 2024-10-26 09:12:11 +02:00 committed by GitHub
parent fa73d3cb49
commit 63788b061b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View File

@ -149,7 +149,7 @@ public class ThingActionsResource implements RESTResource {
@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);

View File

@ -29,8 +29,28 @@ import java.lang.annotation.Target;
@Target(ElementType.METHOD)
public @interface ActionOutput {
/**
* Name of the output parameter
* <p>
* There are some reserved names that make the UI render the output pretty and not just as a text field:
* <ul>
* <li>qrCode: Render the output as a QR code.</li>
* </ul>
*
* @return the name of the output parameter
*/
String name();
/**
* Type of the output parameter
* <p>
* There are some special types that make the UI render the output pretty and not just as a text field:
* <ul>
* <li>qrCode: Render the output as a QR code.</li>
* </ul>
*
* @return the type of the output parameter
*/
String type();
String label() default "";