Skip to content

Commit

Permalink
Fixed issue with swagger2 duplicating the context path
Browse files Browse the repository at this point in the history
fixes #3351
  • Loading branch information
dilipkrish committed Jun 29, 2020
1 parent b01c5b2 commit c289294
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public ResponseEntity<Json> getDocumentation(
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
Swagger swagger = mapper.mapDocumentation(documentation);
swagger.basePath(isEmpty(request.getPath().contextPath().value()) ? "/" : request.getPath().contextPath().value());
if (isEmpty(swagger.getHost())) {
swagger.host(request.getURI().getAuthority());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public ResponseEntity<Json> getDocumentation(
}
Swagger swagger = mapper.mapDocumentation(documentation);
UriComponents uriComponents = componentsFrom(servletRequest, swagger.getBasePath());
swagger.basePath(isEmpty(uriComponents.getPath()) ? "/" : uriComponents.getPath());
if (isEmpty(swagger.getHost())) {
swagger.host(hostName(uriComponents));
}
Expand Down

0 comments on commit c289294

Please sign in to comment.