class ShardController {

    @GET
    @Path("/blocks")
    @Produces(MediaType.APPLICATION_JSON)
    @Operation(
        summary = "Select full shards containing Blocks requested by 'firstIndex' and 'lastIndex' height range",
        description = "Select full shards containing Blocks requested by 'firstIndex' and 'lastIndex' height range values."
            +" Index range is recalculated by default number of blocks to be requested using 'apl.maxAPIRecords' config value",
        tags = {"shards"},
        responses = {
        @ApiResponse(responseCode = "200", description = "Successful execution",
            content = @Content(mediaType = "application/json",
                schema = @Schema(implementation = ShardDTO.class)))
    }    )
    @PermitAll
    public Response getBlocksFromShards(
        @Parameter(description = "A zero-based index to the 'first height' to retrieve (optional)." )
        @QueryParam("firstIndex") @DefaultValue("0") @PositiveOrZero int firstIndex,
        @Parameter(description = "A zero-based index to the 'last height' to retrieve (optional)." )
        @QueryParam("lastIndex") @DefaultValue("-1") int lastIndex
    ) {
        FirstLastIndexParser.FirstLastIndex flIndex = indexParser.adjustIndexes(firstIndex, lastIndex);
        log.debug("getBlocksFromShards( firstIndex = {} / {}, lastIndex = {} / {} ) = ",
            firstIndex, flIndex.getFirstIndex(), lastIndex, flIndex.getLastIndex());
        List<ShardDTO> foundShardsWithBlock = shardService
//            .getShardsByBlockHeightRange(flIndex.getFirstIndex(), flIndex.getLastIndex()).stream() // recalculated
            .getShardsByBlockHeightRange(firstIndex, lastIndex).stream() // straight values
            .map(shard -> shardConverter.convert(shard)).collect(Collectors.toList());
        return Response.ok(foundShardsWithBlock).build();
    }

    @Inject public  ShardController(ShardService shardService, FirstLastIndexParser indexParser);
    public  ShardController();

}