generated from pagopa/template-payments-java-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into path-fix
# Conflicts: # openapi/generated.openapi.json # src/test/java/it/gov/pagopa/pu/organization/OpenApiGeneratorTest.java
- Loading branch information
Showing
17 changed files
with
361 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 19 additions & 31 deletions
50
src/main/java/it/gov/pagopa/pu/organization/config/SwaggerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,29 @@ | ||
package it.gov.pagopa.pu.organization.config; | ||
|
||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; | ||
import io.swagger.v3.oas.annotations.info.Info; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.security.SecurityScheme; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* The Class SwaggerConfig. | ||
*/ | ||
@Configuration | ||
@OpenAPIDefinition( | ||
info = @Info( | ||
title = "${spring.application.name}", | ||
version = "${spring.application.version}", | ||
description = "Api and Models" | ||
), | ||
security = @SecurityRequirement(name = "BearerAuth") | ||
) | ||
@SecurityScheme( | ||
name = "BearerAuth", | ||
type = SecuritySchemeType.HTTP, | ||
bearerFormat = "JWT", | ||
scheme = "bearer" | ||
) | ||
public class SwaggerConfig { | ||
|
||
/** The title. */ | ||
private final String title; | ||
|
||
/** The description. */ | ||
private final String description; | ||
|
||
/** The version. */ | ||
private final String version; | ||
|
||
public SwaggerConfig( | ||
@Value("${swagger.title:${spring.application.name}}") String title, | ||
@Value("${swagger.description:Api and Models}") String description, | ||
@Value("${swagger.version:${spring.application.version}}") String version) { | ||
this.title = title; | ||
this.description = description; | ||
this.version = version; | ||
} | ||
|
||
@Bean | ||
public OpenAPI customOpenAPI() { | ||
return new OpenAPI().components(new Components()).info(new Info() | ||
.title(title) | ||
.description(description) | ||
.version(version)); | ||
} | ||
} |
Oops, something went wrong.