remove 'fields' from parammap because Jackson will throw an exception. put those values in 'facet' instead
@@ -189,12 +189,10 @@ public class GeneWSServer extends GenericRestWSServer {
@ApiImplicitParam(name = "annotation.drugs.gene", value = ParamConstants.ANNOTATION_DRUGS_GENE,
required = false, dataType = "java.util.List", paramType = "query")
})
- public Response groupBy(@DefaultValue("")
- @QueryParam("fields")
- @ApiParam(name = "fields",
- value = "Comma separated list of field(s) to group by, e.g.: biotype.",
- required = true) String fields) {
+ public Response groupBy(@DefaultValue("") @QueryParam("fields") @ApiParam(name = "fields", value = "Comma separated list of "
+ + "field(s) to group by, e.g.: biotype.", required = true) String fields) {
try {
+ renameFieldsToFacet(fields);
GeneQuery geneQuery = new GeneQuery(uriParams);
CellBaseDataResult<Gene> queryResults = geneManager.groupBy(new Query(), fields);
return createOkResponse(queryResults);
@@ -203,6 +201,12 @@ public class GeneWSServer extends GenericRestWSServer {
}
}
+ // fields is not part of genequery, will throw an exception, rename to be "facet"
+ private void renameFieldsToFacet(String fields) {
+ uriParams.remove(uriParams.get("fields"));
+ uriParams.put("facet", fields);
+ }
+
@GET
@Path("/aggregationStats")
@ApiOperation(httpMethod = "GET", value = "Counts gene HGNC symbols by a field(s). ", response = Integer.class,
