jkevan commented on code in PR #429:
URL: https://github.com/apache/unomi/pull/429#discussion_r885507188


##########
extensions/json-schema/rest/src/main/java/org/apache/unomi/schema/rest/JsonSchemaEndPoint.java:
##########
@@ -65,6 +69,22 @@ public Set<String> getInstalledJsonSchemaIds() {
         return schemaService.getInstalledJsonSchemaIds();
     }
 
+    /**
+     * Get a schema by it's id
+     *
+     * @param id of the schema
+     * @return Json schema matching the id
+     */
+    @POST
+    @Path("/query")
+    public String getSchema(String id) {
+        JsonSchemaWrapper schema = schemaService.getSchema(id);
+        if (schema != null) {
+            return schema.getSchema().replace("\n", "");
+        }
+        return "";

Review Comment:
   Probably better to return null ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to