Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add viewer url to the schemas listing #634

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading