majialoong commented on code in PR #22762:
URL: https://github.com/apache/kafka/pull/22762#discussion_r4483750925
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorsResource.java:
##########
@@ -98,7 +106,23 @@ public ConnectorsResource(
}
@GET
- @Operation(summary = "List all active connectors")
+ @Operation(
+ summary = "List all active connectors",
+ parameters = @Parameter(
+ name = "expand",
+ in = ParameterIn.QUERY,
+ description = "Optional connector details to expand. Supported
values are status and info. Repeat this parameter to include both",
+ array = @ArraySchema(schema = @Schema(type = "string",
allowableValues = {"status", "info"}))
+ )
+ )
+ @ApiResponse(
+ responseCode = "200",
+ description = "Connector names retrieved successfully. When expand is
supplied, connector details are returned keyed by connector name",
+ content = @Content(
+ mediaType = MediaType.APPLICATION_JSON,
+ schema = @Schema(oneOf = {String[].class, Object.class})
Review Comment:
Thanks for the review. `Object` is used here because no existing type
represents the full expanded response, and adding one solely for documentation
seems unnecessary.
I've kept the existing `oneOf` and added `additionalPropertiesSchema` to
describe the optional info and status fields under each connector name using
`ConnectorInfo` and `ConnectorStateInfo`.
--
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]