use of org.springdoc.core.Constants.DEFAULT_GROUP_NAME in project jhipster-bom by jhipster.
the class JHipsterSpringDocGroupsConfiguration method openAPIDefaultGroupedOpenAPI.
/**
* OpenApi default group configuration.
*
* @return the GroupedOpenApi configuration
*/
@Bean
@ConditionalOnMissingBean(name = "openAPIDefaultGroupedOpenAPI")
public GroupedOpenApi openAPIDefaultGroupedOpenAPI(List<OpenApiCustomiser> openApiCustomisers, List<OperationCustomizer> operationCustomizers, @Qualifier("apiFirstGroupedOpenAPI") Optional<GroupedOpenApi> apiFirstGroupedOpenAPI, SpringDocConfigProperties springDocConfigProperties) {
log.debug("Initializing JHipster OpenApi default group");
Builder builder = GroupedOpenApi.builder().group(DEFAULT_GROUP_NAME).pathsToMatch(properties.getDefaultIncludePattern());
openApiCustomisers.stream().filter(customiser -> !(customiser instanceof ActuatorOpenApiCustomizer)).forEach(builder::addOpenApiCustomiser);
operationCustomizers.stream().filter(customiser -> !(customiser instanceof ActuatorOperationCustomizer)).forEach(builder::addOperationCustomizer);
apiFirstGroupedOpenAPI.ifPresent(apiFirst -> {
if (apiFirst.getPackagesToScan() != null) {
apiFirst.getPackagesToScan().stream().forEach(builder::packagesToExclude);
}
});
return builder.build();
}
Aggregations