diff --git a/openapi/openapi.json b/openapi/openapi.json index 5d67bb7..8d431b7 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -14,7 +14,10 @@ "url": "https://{host}{basePath}", "variables": { "basePath": { - "default": "/upload/gpd/debt-positions-service/v1" + "default": "/upload/gpd/debt-positions-service/v1", + "enum": [ + "/upload/gpd/debt-positions-service/v1" + ] }, "host": { "default": "api.dev.platform.pagopa.it", @@ -826,4 +829,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/gpd/upload/Application.java b/src/main/java/it/gov/pagopa/gpd/upload/Application.java index 13818b8..b0c248a 100644 --- a/src/main/java/it/gov/pagopa/gpd/upload/Application.java +++ b/src/main/java/it/gov/pagopa/gpd/upload/Application.java @@ -3,12 +3,43 @@ import io.micronaut.runtime.Micronaut; import io.swagger.v3.oas.annotations.*; import io.swagger.v3.oas.annotations.info.*; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.ServerVariable; + @OpenAPIDefinition( - info = @Info( - title = "pagopa-gpd-upload", - version = "0.0.1" - ) + info = @Info( + title = "pagopa-gpd-upload", + version = "${openapi.application.version}", + description = "Microservice to manage PagoPA GPD Upload", + termsOfService = "https://www.pagopa.gov.it/" + ), + servers = { + @Server( + url = "http://localhost:8080" + ), + @Server( + url = "https://{host}{basePath}", + variables = { + @ServerVariable( + name = "basePath", + defaultValue = "/upload/gpd/debt-positions-service/v1", + allowableValues = { + "/upload/gpd/debt-positions-service/v1" + } + ), + @ServerVariable( + name = "host", + defaultValue = "api.dev.platform.pagopa.it", + allowableValues = { + "api.dev.platform.pagopa.it", + "api.uat.platform.pagopa.it", + "api.platform.pagopa.it" + } + ) + } + ) + } ) public class Application { diff --git a/src/main/java/it/gov/pagopa/gpd/upload/config/RequestFilter.java b/src/main/java/it/gov/pagopa/gpd/upload/config/RequestFilter.java index d3d68ad..adea822 100644 --- a/src/main/java/it/gov/pagopa/gpd/upload/config/RequestFilter.java +++ b/src/main/java/it/gov/pagopa/gpd/upload/config/RequestFilter.java @@ -9,16 +9,15 @@ import org.reactivestreams.Publisher; @Slf4j -@Filter("/**") +@Filter("/brokers") public class RequestFilter implements HttpServerFilter { @Override public Publisher> doFilter(HttpRequest request, ServerFilterChain chain) { - if(!request.getPath().equals("/info")) { - log.info("Request: " + request.getMethodName() + request.getPath() + ", content-length: " + request.getContentLength()); - request.getHeaders().forEach(h -> log.debug( - "header: " + h.getKey() + " = " + h.getValue()) - ); - } + log.info("Request: " + request.getMethodName() + request.getPath() + ", content-length: " + request.getContentLength()); + request.getHeaders().forEach(h -> log.debug( + "header: " + h.getKey() + " = " + h.getValue()) + ); + return chain.proceed(request); } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 61fedb8..a398002 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,6 @@ info.application.artifactId=${project.artifactId} info.application.version=${project.version} +openapi.application.version=0.1.22 info.properties.environment=env micronaut.application.name=GPD-Massive-Upload-service micronaut.router.static-resources.swagger.paths=classpath:META-INF/swagger