Added possibility to get the whole item instead of just the name

This commit is contained in:
Luca Frosini 2022-07-26 12:06:10 +02:00
parent 0d194a28a3
commit 2b551f0ee1
1 changed files with 10 additions and 0 deletions

View File

@ -486,6 +486,16 @@ public class CKANPackage extends CKAN implements Moderated {
ArrayNode results = (ArrayNode) result.get(RESULTS_KEY);
boolean allFields = false;
MultivaluedMap<String,String> queryParameters = uriInfo.getQueryParameters();
if(queryParameters.containsKey(GCatConstants.ALL_FIELDS_QUERY_PARAMETER)) {
allFields = Boolean.parseBoolean(queryParameters.get(GCatConstants.ALL_FIELDS_QUERY_PARAMETER).get(0));
}
if(allFields) {
return getAsString(results);
}
ArrayNode arrayNode = mapper.createArrayNode();
for(JsonNode node : results) {
try {