You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2023/01/19 12:12:46 UTC

[GitHub] [ignite-3] PakhomovAlexander commented on a diff in pull request #1549: IGNITE-18586 Add descriptions for REST components

PakhomovAlexander commented on code in PR #1549:
URL: https://github.com/apache/ignite-3/pull/1549#discussion_r1081168521


##########
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/InvalidParam.java:
##########
@@ -20,13 +20,17 @@
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonGetter;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
 import java.util.Objects;
 
 /**
  * Parameter validation result.
  */
+@Schema(description = "Information about invalid request parameter.")
 public class InvalidParam {
+    @Schema(description = "Parameter name.")
     private final String name;
+    @Schema(description = "THe issue with the parameter.")

Review Comment:
   ```suggestion
       @Schema(description = "The issue with the parameter.")
   ```



##########
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/metric/MetricSourceDto.java:
##########
@@ -25,12 +25,14 @@
 /**
  * REST representation of MetricSource.
  */
-@Schema(name = "MetricSource")
+@Schema(name = "MetricSource", description = "Metric sources. Provided by modules")

Review Comment:
   ```suggestion
   @Schema(name = "MetricSource", description = "Metric sources provided by modules.")
   ```



##########
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/configuration/ClusterConfigurationApi.java:
##########
@@ -86,20 +88,21 @@ public interface ClusterConfigurationApi {
      * @param path to represent a cluster configuration.
      * @return system configuration in HOCON format represented by given path.
      */
-    @Operation(operationId = "getClusterConfigurationByPath")
+    @Operation(operationId = "getClusterConfigurationByPath",
+            description = "Gets the configuration on the specific path. Configuration is in HOCON format")
     @ApiResponse(responseCode = "200",
             content = @Content(mediaType = MediaType.TEXT_PLAIN, schema = @Schema(type = "string")),
-            description = "Configuration represented by path")
-    @ApiResponse(responseCode = "500", description = "Internal error",
+            description = "Configuration of the cluster on the specified path.")
+    @ApiResponse(responseCode = "500", description = "Internal error.",
             content = @Content(mediaType = MediaType.PROBLEM_JSON, schema = @Schema(implementation = Problem.class)))
-    @ApiResponse(responseCode = "400", description = "Incorrect configuration",
+    @ApiResponse(responseCode = "400", description = "Incorrect configuration.",
             content = @Content(mediaType = MediaType.PROBLEM_JSON, schema = @Schema(implementation = Problem.class)))
-    @ApiResponse(responseCode = "404", description = "Configuration not found, it means that the cluster is not initialized",
+    @ApiResponse(responseCode = "404", description = "Configuration not found. Most likely, the cluster is not initialized.",
             content = @Content(mediaType = MediaType.PROBLEM_JSON, schema = @Schema(implementation = Problem.class)))
     @Produces({
             MediaType.TEXT_PLAIN,
             MediaType.PROBLEM_JSON
     })
     @Get("/{path}")
-    String getConfigurationByPath(@PathVariable("path") String path);
+    String getConfigurationByPath(@PathVariable("path") @Parameter(required = true, description = "Cluster address.")  String path);

Review Comment:
   No, this is not the cluster address. This is the `path` that represents the configuration subtree. For example, given configuration:
   
   ```json
   one: {
     two: {
       three: "value"
     }
   }
   ```
   Then the `path = one.two` will represent a configuration subtree:
   ```json
   three: "value"
   ```
   



##########
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/configuration/NodeConfigurationApi.java:
##########
@@ -45,14 +46,14 @@ public interface NodeConfigurationApi {
      *
      * @return the whole node configuration in HOCON format.
      */
-    @Operation(operationId = "getNodeConfiguration")
+    @Operation(operationId = "getNodeConfiguration", description = "Gets node configuratoon in HOCON format.")

Review Comment:
   ```suggestion
       @Operation(operationId = "getNodeConfiguration", description = "Gets node configuration in HOCON format.")
   ```



##########
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/configuration/NodeConfigurationApi.java:
##########
@@ -67,32 +68,34 @@ public interface NodeConfigurationApi {
      * @param path to represent a node configuration.
      * @return system configuration in HOCON format represented by given path.
      */
-    @Operation(operationId = "getNodeConfigurationByPath")
+    @Operation(operationId = "getNodeConfigurationByPath",
+            description = "Gets a configuration of a specific node, in HOCON format.")
     @ApiResponse(responseCode = "200",
             content = @Content(mediaType = MediaType.TEXT_PLAIN,
                     schema = @Schema(type = "string")),
-            description = "Configuration represented by path")
-    @ApiResponse(responseCode = "500", description = "Internal error",
+            description = "Returned node configuration.")
+    @ApiResponse(responseCode = "500", description = "Internal error.",
             content = @Content(mediaType = MediaType.PROBLEM_JSON, schema = @Schema(implementation = Problem.class)))
-    @ApiResponse(responseCode = "400", description = "Incorrect configuration",
+    @ApiResponse(responseCode = "400", description = "Incorrect configuration.",
             content = @Content(mediaType = MediaType.PROBLEM_JSON, schema = @Schema(implementation = Problem.class)))
     @Produces({
             MediaType.TEXT_PLAIN,
             MediaType.PROBLEM_JSON
     })
     @Get("/{path}")
-    String getConfigurationByPath(@PathVariable("path") String path);
+    String getConfigurationByPath(@PathVariable("path") @Parameter(required = true, description = "Node address.") String path);

Review Comment:
   the same for path



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org