Skip to content

Commit

Permalink
feat: add viewer url to the schemas listing (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladisavvv authored Jan 9, 2025
1 parent 0229c40 commit b01f3e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class ApplicationTypeSchemaController {
private static final String ID_FIELD = "$id";
private static final String ID_PARAM = "id";
private static final String EDITOR_URL_FIELD = "dial:applicationTypeEditorUrl";
private static final String VIEWER_URL_FIELD = "dial:applicationTypeViewerUrl";
private static final String DISPLAY_NAME_FIELD = "dial:applicationTypeDisplayName";
private static final String COMPLETION_ENDPOINT_FIELD = "dial:applicationTypeCompletionEndpoint";

Expand Down Expand Up @@ -90,6 +91,11 @@ private List<JsonNode> listSchemas() throws JsonProcessingException {
filteredNode.set(ID_FIELD, schemaNode.get(ID_FIELD));
filteredNode.set(EDITOR_URL_FIELD, schemaNode.get(EDITOR_URL_FIELD));
filteredNode.set(DISPLAY_NAME_FIELD, schemaNode.get(DISPLAY_NAME_FIELD));

if (schemaNode.has(VIEWER_URL_FIELD)) {
filteredNode.set(VIEWER_URL_FIELD, schemaNode.get(VIEWER_URL_FIELD));
}

filteredSchemas.add(filteredNode);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void testApplicationTypeSchemaList_ok() {
Assertions.assertTrue(node.has("$id"));
Assertions.assertTrue(node.has("dial:applicationTypeEditorUrl"));
Assertions.assertTrue(node.has("dial:applicationTypeDisplayName"));
Assertions.assertTrue(node.has("dial:applicationTypeViewerUrl"));
});
}

Expand Down

0 comments on commit b01f3e9

Please sign in to comment.