epugh commented on code in PR #4203:
URL: https://github.com/apache/solr/pull/4203#discussion_r3448591949


##########
solr/core/src/java/org/apache/solr/handler/designer/SchemaDesigner.java:
##########
@@ -347,25 +348,31 @@ public void getSampleValue(SolrQueryRequest req, 
SolrQueryResponse rsp) throws I
 
     if (textValue != null) {
       var analysis = configSetHelper.analyzeField(configSet, fieldName, 
textValue);
-      rsp.getValues().addAll(Map.of(idField, docId, fieldName, textValue, 
"analysis", analysis));
+      return buildFlexibleResponse(
+          Map.of(idField, docId, fieldName, textValue, "analysis", analysis));
     }
+    return instantiateJerseyResponse(FlexibleSolrJerseyResponse.class);
   }
 
-  @EndPoint(
-      method = GET,
-      path = "/schema-designer/collectionsForConfig",
-      permission = CONFIG_READ_PERM)
-  public void listCollectionsForConfig(SolrQueryRequest req, SolrQueryResponse 
rsp) {
-    final String configSet = getRequiredParam(CONFIG_SET_PARAM, req);
-    rsp.getValues()
-        .addAll(Map.of("collections", 
configSetHelper.listCollectionsForConfig(configSet)));
+  @Override
+  @PermissionName(CONFIG_READ_PERM)
+  public SchemaDesignerCollectionsResponse listCollectionsForConfig(String 
configSet) {
+    requireNotEmpty(CONFIG_SET_PARAM, configSet);
+    SchemaDesignerCollectionsResponse response =
+        instantiateJerseyResponse(SchemaDesignerCollectionsResponse.class);
+    response.collections = configSetHelper.listCollectionsForConfig(configSet);
+    return response;
   }
 
   // CONFIG_EDIT_PERM is required here since this endpoint is used by the UI 
to determine if the
   // user has access to the Schema Designer UI
-  @EndPoint(method = GET, path = "/schema-designer/configs", permission = 
CONFIG_EDIT_PERM)
-  public void listConfigs(SolrQueryRequest req, SolrQueryResponse rsp) throws 
IOException {
-    rsp.getValues().addAll(Map.of("configSets", listEnabledConfigs()));
+  @Override
+  @PermissionName(CONFIG_EDIT_PERM)
+  public SchemaDesignerConfigsResponse listConfigs() throws Exception {
+    SchemaDesignerConfigsResponse response =
+        instantiateJerseyResponse(SchemaDesignerConfigsResponse.class);
+    response.configSets = listEnabledConfigs();

Review Comment:
   there is a difference, but you wouldn't know it from the API.   Going to 
provide a proper description and a nicer name.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to