Skip to content

Commit

Permalink
Fix swagger UI (#51)
Browse files Browse the repository at this point in the history
* Downgrade springfox-swagger.version for tests. Do not use this

* Followed https://github.com/springfox/springfox\#migrating-from-earlier-snapshot

* Added Guava back
  • Loading branch information
lvarin authored Oct 24, 2023
1 parent df6446f commit cb9a811
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,14 @@
<scope>test</scope>
</dependency>
<!--SpringFox dependencies -->
<dependency>
<!--dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-swagger.version}</version>
</dependency-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${springfox-swagger.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
private final ErrorAttributes errorAttributes;
private final HttpMessageConverters messageConverters;
private final AuthorisationProperties authorisationProperties;
private final String[] ALLOWED_URLS = {"/", "/v2/api-docs", "/configuration/ui", "/swagger-resources/**", "/configuration/**", "/swagger-ui.html", "/webjars/**"};
private final String[] ALLOWED_URLS = {"/", "/v2/api-docs", "/configuration/ui", "/swagger-resources/**", "/configuration/**", "/swagger-ui/**", "/webjars/**"};
private final String baseUrl;

public ResourceServerConfiguration(ErrorAttributes errorAttributes, HttpMessageConverters messageConverters,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/uk/ac/ebi/tsc/tesk/tes/api/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class HomeController {

@RequestMapping(value = "/")
public String index() {
return "redirect:swagger-ui.html";
return "redirect:swagger-ui/index.html";
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spring.jackson.deserialization.fail_on_unknown_properties=true
#Make Spring throw 404 for unknown paths (but we had to disable mapping to static resources, apart from swagger)
#404 will be handled uniformly in CustomErrorHandler advice
spring.mvc.throw-exception-if-no-handler-found=true
spring.mvc.static-path-pattern=/swagger-ui.html
#spring.mvc.static-path-pattern=/swagger-ui.html
#spring.resources.add-mappings=false
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
spring.main.allow-bean-definition-overriding=true
Expand Down

0 comments on commit cb9a811

Please sign in to comment.