For API "GET /assets" add optional query param "includeData"

This commit is contained in:
catbref 2019-04-04 12:33:12 +01:00
parent 97142fdde8
commit 7026c35e73

View File

@ -92,7 +92,8 @@ public class AssetsResource {
@ApiErrors({
ApiError.REPOSITORY_ISSUE
})
public List<AssetData> getAllAssets(@Parameter(
public List<AssetData> getAllAssets(@QueryParam("includeData") Boolean includeData,
@Parameter(
ref = "limit"
) @QueryParam("limit") Integer limit, @Parameter(
ref = "offset"
@ -102,7 +103,8 @@ public class AssetsResource {
try (final Repository repository = RepositoryManager.getRepository()) {
List<AssetData> assets = repository.getAssetRepository().getAllAssets(limit, offset, reverse);
assets.forEach(asset -> asset.setData(null));
if (includeData == null || !includeData)
assets.forEach(asset -> asset.setData(null));
return assets;
} catch (DataException e) {