package io.jenkins.plugins.endpoints;

import io.jenkins.plugins.schedule.JobScheduler;
import io.jenkins.plugins.service.SearchService;
import io.jenkins.plugins.service.ServiceException;
import org.glassfish.hk2.api.Immediate;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Arrays;

@Path("/plugins")
@Produces(MediaType.APPLICATION_JSON)
@Immediate
public class Plugins {

  private final Logger logger = LoggerFactory.getLogger(Plugins.class);

  @Inject
  private SearchService searchService;

  // Hackity hack hack. This is only here because I can't figure out how to successfully
  // get the JobScheduler in RestApp from the ServiceLocator. Whenever I try I get NPE
  // so this injection at least makes @PostConstruct fire
  @Inject
  private JobScheduler jobScheduler;

  @GET
  public String search(
      @QueryParam("q") String query,
      @DefaultValue("name") @QueryParam("sort") String sort,
      @DefaultValue("") @QueryParam("labels") String labels,
      @DefaultValue("") @QueryParam("authors")String authors,
      @DefaultValue("") @QueryParam("core")String core,
      @DefaultValue("50") @QueryParam("size") int size,
      @DefaultValue("1") @QueryParam("page") int page) {
    try {
      final JSONObject result = searchService.search(query, sort, Arrays.asList(labels.split(",")), Arrays.asList(authors.split(",")), core, size, page);
      return result.toString(2);
    } catch (ServiceException e) {
      logger.error("Problem executing ES query", e);
      throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
    }
  }

}

@@ -444,22 +444,20 @@
 va.util.
-Arrays
+List
 ;%0A%0A@Path
@@ -1081,34 +1081,16 @@
 t,%0A     
- @DefaultValue(%22%22)
  @QueryP
@@ -1104,22 +1104,28 @@
 abels%22) 
+List%3C
 String
+%3E
  labels,
@@ -1130,34 +1130,16 @@
 s,%0A     
- @DefaultValue(%22%22)
  @QueryP
@@ -1153,22 +1153,29 @@
 uthors%22)
+ List%3C
 String
+%3E
  authors
@@ -1425,75 +1425,23 @@
 rt, 
-Arrays.asList(labels.split(%22,%22)), Arrays.asList(authors.split(%22,%22))
+labels, authors
 , co

Switch params to List