Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopocarlini committed Sep 25, 2024
1 parent e5fe17b commit 6af012b
Showing 1 changed file with 58 additions and 44 deletions.
102 changes: 58 additions & 44 deletions src/main/java/it/gov/pagopa/payments/controller/BaseController.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class BaseController {
@Value("${info.application.name}")
private String name;

@Value("${application.version}")
@Value("${info.application.version}")
private String version;

@Value("${info.properties.environment}")
Expand All @@ -47,50 +47,64 @@ public RedirectView home() {
}

@Operation(
summary = "health check",
description = "Return OK if application is started",
security = {
@SecurityRequirement(name = "ApiKey"),
@SecurityRequirement(name = "Authorization")
},
tags = {"Home"})
summary = "health check",
description = "Return OK if application is started",
security = {
@SecurityRequirement(name = "ApiKey"),
@SecurityRequirement(name = "Authorization")
},
tags = {"Home"}
)
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "OK",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = AppInfo.class))),
@ApiResponse(
responseCode = "400",
description = "Bad Request",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ProblemJson.class))),
@ApiResponse(
responseCode = "401",
description = "Unauthorized",
content = @Content(schema = @Schema())),
@ApiResponse(
responseCode = "403",
description = "Forbidden",
content = @Content(schema = @Schema())),
@ApiResponse(
responseCode = "429",
description = "Too many requests",
content = @Content(schema = @Schema())),
@ApiResponse(
responseCode = "500",
description = "Service unavailable",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ProblemJson.class)))
})
@GetMapping(value = "/info", produces = {MediaType.APPLICATION_JSON_VALUE})
value = {
@ApiResponse(
responseCode = "200",
description = "OK",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = AppInfo.class)
)
),
@ApiResponse(
responseCode = "400",
description = "Bad Request",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ProblemJson.class)
)
),
@ApiResponse(
responseCode = "401",
description = "Unauthorized",
content = @Content(schema = @Schema())
),
@ApiResponse(
responseCode = "403",
description = "Forbidden",
content = @Content(schema = @Schema())
),
@ApiResponse(
responseCode = "429",
description = "Too many requests",
content = @Content(schema = @Schema())
),
@ApiResponse(
responseCode = "500",
description = "Service unavailable",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ProblemJson.class)
)
)
}
)
@GetMapping(
value = "/info",
produces = {MediaType.APPLICATION_JSON_VALUE}
)
@ResponseStatus(HttpStatus.OK)
public ResponseEntity<AppInfo> healthCheck() {
// Used just for health checking
Expand Down

0 comments on commit 6af012b

Please sign in to comment.