Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.spring4all</groupId>
<artifactId>spring-boot-starter-swagger</artifactId>
<version>1.5.0.RELEASE</version>
<version>1.5.1.RELEASE</version>

<name>spring-boot-starter-swagger</name>
<url>https://github.com/SpringForAll/spring-boot-starter-swagger</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public SwaggerProperties swaggerProperties() {
@ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true)
public List<Docket> createRestApi(SwaggerProperties swaggerProperties) {
ConfigurableBeanFactory configurableBeanFactory = (ConfigurableBeanFactory) beanFactory;
List<Docket> docketList = new LinkedList<>();

// 没有分组
if (swaggerProperties.getDocket().size() == 0) {
Expand Down Expand Up @@ -81,7 +82,6 @@ public List<Docket> createRestApi(SwaggerProperties swaggerProperties) {
excludePath.add(PathSelectors.ant(path));
}


Docket docket = new Docket(DocumentationType.SWAGGER_2)
.host(swaggerProperties.getHost())
.apiInfo(apiInfo)
Expand All @@ -98,11 +98,11 @@ public List<Docket> createRestApi(SwaggerProperties swaggerProperties) {
.build();

configurableBeanFactory.registerSingleton("defaultDocket", docket);
return null;
docketList.add(docket);
return docketList;
}

// 分组创建
List<Docket> docketList = new LinkedList<>();
for (String groupName : swaggerProperties.getDocket().keySet()) {
SwaggerProperties.DocketInfo docketInfo = swaggerProperties.getDocket().get(groupName);

Expand Down