feature(server): extensions list explicit type
Changing the extensionType parameter to be of the proper type instead of a String and later converting to Type.
Closes
@@ -246,7 +246,7 @@ public class ExtensionHandler extends BaseHandler implements Getter<Extension>,
@Parameter(name = "page", in = ParameterIn.QUERY, schema = @Schema(type = "integer", defaultValue = "1"), description = "Page number to return")
@Parameter(name = "per_page", in = ParameterIn.QUERY, schema = @Schema(type = "integer", defaultValue = "20"), description = "Number of records per page")
@Parameter(name = "query", in = ParameterIn.QUERY, schema = @Schema(type = "string"), description = "The search query to filter results on")
- public ListResult<Extension> list(@Context UriInfo uriInfo, @Parameter(required = false) @QueryParam("extensionType") String extensionType) {
+ public ListResult<Extension> list(@Context UriInfo uriInfo, @Parameter(required = false) @QueryParam("extensionType") Extension.Type extensionType) {
// Defaulting to display only Installed extensions
String query = uriInfo.getQueryParameters().getFirst("query");
if (query == null) {
@@ -257,7 +257,7 @@ public class ExtensionHandler extends BaseHandler implements Getter<Extension>,
Extension.class,
new ReflectiveFilterer<>(Extension.class, FilterOptionsParser.fromString(query)),
new PredicateFilter<>(
- extension -> extensionType == null || extension.getExtensionType().equals(Extension.Type.valueOf(extensionType))
+ extension -> extensionType == null || extension.getExtensionType().equals(extensionType)
),
new ReflectiveSorter<>(Extension.class, new SortOptionsFromQueryParams(uriInfo)),
new PaginationFilter<>(new PaginationOptionsFromQueryParams(uriInfo))
