Skip to content

Commit 462ec39

Browse files
committed
Revert swagger-ui-dist version
upgrading causes ui bugs; switching to spring docs points to a different url (instead of swagger-ui.html, it's swagger-ui/index.html. There is a redirect but we'd also have to make proxy changes to allow the new url to pass through) Revert "Using springdoc seems to be the recommended path forward with spring boot 3"
1 parent 13af199 commit 462ec39

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

build.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ dependencies {
209209

210210
implementation 'org.apache.httpcomponents.client5:httpclient5'
211211

212-
// springdoc includes the swagger-ui
213-
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
214212
implementation 'io.swagger.core.v3:swagger-annotations'
215213
swaggerCodegen 'io.swagger.codegen.v3:swagger-codegen-cli'
216214

@@ -356,6 +354,7 @@ dependencies {
356354
generatedCompile 'org.springframework.boot:spring-boot-starter-validation'
357355
implementation 'org.springframework.boot:spring-boot-starter-validation'
358356
implementation 'org.webjars:webjars-locator-core'
357+
runtimeOnly 'org.webjars.npm:swagger-ui-dist:4.3.0'
359358
generatedCompile 'io.swagger.core.v3:swagger-annotations'
360359

361360
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

src/main/java/bio/terra/app/configuration/WebConfig.java

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.springframework.stereotype.Component;
77
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
88
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
9+
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
910
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
1011
import org.springframework.web.util.UrlPathHelper;
1112

@@ -30,4 +31,11 @@ public void configurePathMatch(PathMatchConfigurer configurer) {
3031
urlPathHelper.setUrlDecode(false);
3132
configurer.setUrlPathHelper(urlPathHelper);
3233
}
34+
35+
@Override
36+
public void addResourceHandlers(ResourceHandlerRegistry registry) {
37+
registry
38+
.addResourceHandler("/webjars/swagger-ui-dist/**")
39+
.addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui-dist/4.3.0/");
40+
}
3341
}

src/main/resources/application.properties

-1
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,3 @@ duos.basePath=https://consent.dsde-dev.broadinstitute.org
154154
tps.basePath=https://tps.dsde-dev.broadinstitute.org
155155
sentry.dsn=
156156
sentry.environment=undefined
157-
springdoc.swagger-ui.path=/swagger-ui.html

0 commit comments

Comments
 (0)