From fef02a03b965063418da6b883ac86de7908e9b04 Mon Sep 17 00:00:00 2001 From: dschiese Date: Sat, 9 Nov 2024 11:09:40 +0100 Subject: [PATCH] Fixed OpenAPI definition --- .../controller/ExplanationController.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/wse/qanaryexplanationservice/controller/ExplanationController.java b/src/main/java/com/wse/qanaryexplanationservice/controller/ExplanationController.java index a87cc96..673b904 100644 --- a/src/main/java/com/wse/qanaryexplanationservice/controller/ExplanationController.java +++ b/src/main/java/com/wse/qanaryexplanationservice/controller/ExplanationController.java @@ -227,21 +227,22 @@ public ResponseEntity getComposedExplanation(@RequestBody QanaryExplanationDa @GetMapping(value = "/explainmethods") @Operation( summary = "Explains all methods for the passed component with the desired template", - description = "Explains all methods for the passed component. The templates can be specified depending on the needs." + - "Additionally, a specific SPARQL query can be passed. The variables used in the SPARQL query must match the placeholder-names within the passed template." + - "For the body (JSON) it's sufficient to pass the component name only (\"qanaryComponent\": \"NED-DBpediaSpotlight\" // for example).", + description = "Explains all methods for the passed component. The templates can be specified depending on the requirements." + + "Additionally, a specific SPARQL query can be passed. The variables used in the SPARQL query must match the placeholder-names within the passed template.", requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody( description = "JSON body", content = @Content( schema = @Schema( - example = "{\n" + - " \"qanaryComponent\":\"REQUIRED\",\n" + - " \"graph\":\"REQUIRED\",\n" + - " \"doGenerative\": DECIDE WHETHER TO GENERATE LLM OR TEMPLATE EXPLANATIONS,\n" + - " \"itemTemplate\": INSERT SPECIFIC ITEM TEMPLATE (null if not),\n" + - " \"prefixTemplate\": INSERT SPECIFIC PREFIX TEMPLATE (null if not),\n" + - " \"requestQuery\": PASS SPECIFIC SPARQL QUERY (CARE THAT VARIABLE NAMES MATCH WITH PLACEHOLDERS) (null if not)\n" + - "}" + example = """ + { + "qanaryComponent": "REQUIRED", + "graph": "REQUIRED", + "doGenerative": "DECIDE WHETHER TO GENERATE LLM OR TEMPLATE EXPLANATIONS (true or false)", + "itemTemplate": "INSERT SPECIFIC ITEM TEMPLATE (null if not)", + "prefixTemplate": "INSERT SPECIFIC PREFIX TEMPLATE (null if not)", + "requestQuery": "PASS SPECIFIC SPARQL QUERY (CARE THAT VARIABLE NAMES MATCH WITH PLACEHOLDERS) (null if not)" + } + """ ) ) )