content: package com.konsol.beatstream.config;
  
  import org.springdoc.core.models.GroupedOpenApi;
  import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.context.annotation.Profile;
  import tech.jhipster.config.JHipsterConstants;
  import tech.jhipster.config.JHipsterProperties;
  import tech.jhipster.config.apidoc.customizer.JHipsterOpenApiCustomizer;
  
  @Configuration
  @Profile(JHipsterConstants.SPRING_PROFILE_API_DOCS)
  public class OpenApiConfiguration {
  
      public static final String API_FIRST_PACKAGE = "com.konsol.beatstream.web.api";
  
      @Bean
      @ConditionalOnMissingBean(name = "apiFirstGroupedOpenAPI")
      public GroupedOpenApi apiFirstGroupedOpenAPI(
          JHipsterOpenApiCustomizer jhipsterOpenApiCustomizer,
          JHipsterProperties jHipsterProperties
      ) {
          JHipsterProperties.ApiDocs properties = jHipsterProperties.getApiDocs();
          return GroupedOpenApi.builder()
              .group("openapi")
              .addOpenApiCustomizer(jhipsterOpenApiCustomizer)
              .packagesToScan(API_FIRST_PACKAGE)
              .pathsToMatch(properties.getDefaultIncludePattern())
              .build();
      }
  }
  