View Javadoc
1   package fr.tiogars.chat.config;
2   
3   import io.swagger.v3.oas.models.OpenAPI;
4   import io.swagger.v3.oas.models.Components;
5   import io.swagger.v3.oas.models.info.Info;
6   import io.swagger.v3.oas.models.security.SecurityScheme;
7   import org.springframework.context.annotation.Bean;
8   import org.springframework.context.annotation.Configuration;
9   
10  /**
11   * Configures the public OpenAPI description for the service.
12   */
13  @Configuration
14  class OpenApiConfiguration {
15  
16      /**
17       * Creates the service OpenAPI metadata.
18       *
19       * @return OpenAPI description for Stored Data Domains
20       */
21      @Bean
22      OpenAPI chatOpenApi() {
23          return new OpenAPI()
24              .components(new Components()
25                  .addSecuritySchemes("bearerAuth", new SecurityScheme()
26                      .type(SecurityScheme.Type.HTTP)
27                      .scheme("bearer")
28                      .bearerFormat("JWT")))
29                  .info(new Info()
30                          .title("Task API")
31                          .version("v1")
32                  .description("CRUD API for the Task business object with JWT authentication."));
33      }
34  }