@GET
  @Path("/{name}/{version}")
  @ApiOperation(
      value = "Documents by name and version",
      notes = "Documents always have a name and a version",
      response = DocumentDTO.class,
      responseContainer = "List")
  public List<DocumentDTO> documentByNameAndVersion(
      @ApiParam(value = "Name of documents to fetch", required = true) @PathParam("name")
          String name,
      @ApiParam(value = "Version of named documents", required = true) @PathParam("version")
          String version,
      @ApiParam(value = "Whether to re-index document", required = false, defaultValue = "false")
          @DefaultValue("false")
          @QueryParam("reindex")
          boolean reindex) {

    List<Document> documents = documentRepository.findDocumentsByNameAndVersion(name, version);

    if (reindex) {
      documents.stream().forEach(document -> documentationService.reindexDocument(document));
    }

    return documents
        .stream()
        .map(Transformations::convertDocumentToDTO)
        .collect(Collectors.toList());
  }