Skip to content

Commit

Permalink
[GLT-4259] updated springfox-swagger library (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
djcooke authored Aug 27, 2024
1 parent db3ead0 commit d94f942
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 74 deletions.
40 changes: 20 additions & 20 deletions pinery-ws/src/main/java/ca/on/oicr/pinery/ws/StatusController.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@
@RequestMapping("/")
@ApiIgnore
public class StatusController {
public static final ServerConfig SERVER_CONFIG =
new ServerConfig() {
public static final ServerConfig SERVER_CONFIG = new ServerConfig() {

@Override
public Stream<NavigationMenu> navigation() {
return Stream.empty();
}
@Override
public Stream<NavigationMenu> navigation() {
return Stream.empty();
}

@Override
public String name() {
return "Pinery";
}
@Override
public String name() {
return "Pinery";
}

@Override
public Stream<Header> headers() {
return Stream.empty();
}
@Override
public Stream<Header> headers() {
return Stream.empty();
}

@Override
public String documentationUrl() {
return "swagger-ui.html";
}
};
@Override
public String documentationUrl() {
return "swagger-ui/index.html";
}
};

@Autowired private Cache cache;
@Autowired
private Cache cache;

@Value("${pinery.cache.interval:900000}")
private int cacheInterval;
Expand Down
107 changes: 55 additions & 52 deletions pinery-ws/src/main/webapp/WEB-INF/spring-servlet.xml
Original file line number Diff line number Diff line change
@@ -1,57 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">

<context:property-placeholder location="classpath:project.properties,${pinery.propertiesFile}" ignore-unresolvable="true"/>
<context:component-scan base-package="ca.on.oicr.pinery" />

<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="objectMapper">
<bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
<property name="simpleDateFormat" value="hh:MM:ss'T'HH:mm:ssXXX"/>
<property name="featuresToEnable">
<array>
<util:constant static-field="com.fasterxml.jackson.databind.SerializationFeature.INDENT_OUTPUT"/>
</array>
</property>
<property name="featuresToDisable">
<array>
<util:constant static-field="com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS"/>
</array>
</property>
</bean>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>

<!-- static mapping for swagger ui -->
<mvc:resources location="classpath:/META-INF/resources/" mapping="swagger-ui.html"/>
<mvc:resources location="classpath:/META-INF/resources/webjars/" mapping="/webjars/**"/>

<bean class="ca.on.oicr.pinery.ws.component.SwaggerConfig"/>

<task:annotation-driven/>

<!-- Profiles (keep below all other beans) -->
<beans profile="external">
<import resource="classpath:${pinery.external.springConfigFile}"/>
</beans>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">

<context:property-placeholder location="classpath:project.properties,${pinery.propertiesFile}"
ignore-unresolvable="true" />
<context:component-scan base-package="ca.on.oicr.pinery" />

<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="objectMapper">
<bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
<property name="simpleDateFormat" value="hh:MM:ss'T'HH:mm:ssXXX" />
<property name="featuresToEnable">
<array>
<util:constant
static-field="com.fasterxml.jackson.databind.SerializationFeature.INDENT_OUTPUT" />
</array>
</property>
<property name="featuresToDisable">
<array>
<util:constant
static-field="com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS" />
</array>
</property>
</bean>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>

<!-- static mapping for swagger ui -->
<mvc:resources location="classpath:/META-INF/resources/webjars/springfox-swagger-ui/"
mapping="/swagger-ui/**" />

<bean class="ca.on.oicr.pinery.ws.component.SwaggerConfig" />

<task:annotation-driven />

<!-- Profiles (keep below all other beans) -->
<beans profile="external">
<import resource="classpath:${pinery.external.springConfigFile}" />
</beans>

</beans>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<spring.version>5.3.27</spring.version>
<resteasy.version>3.14.0.Final</resteasy.version>
<server-utils.version>1.0.1</server-utils.version>
<springfox.version>2.9.2</springfox.version>
<springfox.version>3.0.0</springfox.version>
<junit.version>4.13.1</junit.version>
<hamcrest.version>1.3</hamcrest.version>
<commons-lang.version>2.6</commons-lang.version>
Expand Down Expand Up @@ -447,4 +447,4 @@
<url>https://artifacts.oicr.on.ca/artifactory/gsi-snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
</project>

0 comments on commit d94f942

Please sign in to comment.