Skip to content

Commit 64ac49e

Browse files
author
bnasslahsen
committed
allow (pathsToMatch and packagesToScan) to be absent, if openApiCustomisers is present
1 parent f68ecd4 commit 64ac49e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

springdoc-openapi-common/src/main/java/org/springdoc/core/GroupedOpenApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ private GroupedOpenApi(Builder builder) {
4343
this.packagesToScan = builder.packagesToScan;
4444
this.openApiCustomisers = Objects.requireNonNull(builder.openApiCustomisers);
4545
SwaggerUiConfigProperties.addGroup(this.group);
46-
if (CollectionUtils.isEmpty(this.pathsToMatch) && CollectionUtils.isEmpty(this.packagesToScan))
47-
throw new IllegalStateException("Packages to scan or paths to filter can not be both null for the group:" + this.group);
46+
if (CollectionUtils.isEmpty(this.pathsToMatch) && CollectionUtils.isEmpty(this.packagesToScan) && CollectionUtils.isEmpty(openApiCustomisers))
47+
throw new IllegalStateException("Packages to scan or paths to filter or openApiCustomisers can not be all null for the group:" + this.group);
4848
}
4949

5050
public static Builder builder() {

0 commit comments

Comments
 (0)