Skip to content

Commit

Permalink
Merge branch 'main' into PPANTT-73-performance-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svariant authored Oct 1, 2024
2 parents 91e9d2b + f15d2d5 commit 6d83189
Show file tree
Hide file tree
Showing 6 changed files with 286 additions and 142 deletions.
270 changes: 135 additions & 135 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
@@ -1,187 +1,187 @@
{
"openapi": "3.0.3",
"info": {
"title": "PagoPa Payment Options (TEST)",
"description": "PagoPa Payment Options description",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.4.2"
"openapi" : "3.0.3",
"info" : {
"title" : "PagoPa Payment Options (TEST)",
"description" : "PagoPa Payment Options service \n ### APP ERROR CODES ### \n\n\n <details><summary>Details</summary>\n **NAME** | **HTTP STATUS CODE** | **DESCRIPTION** \n- | - | - \n **ODP-001** | *Bad Request* | ODP-SINTASSI. Errore riportato in caso di errore di sintassi nel contenuto della richiesta verso ODP\n **ODP-002** | *Not Found* | ODP_PSP_SCONOSCIUTO. Errore riportato in caso non sia presente fra i dati ottenuti da config-cache un psp coincidente con l’id fornito in input\n **ODP-003** | *Bad Request* | ODP_PSP_DISABILITATO. Errore riportato in caso il psp coincidente con l’id fornito in input risulti disabilitato\n **ODP-004** | *Not Found* | ODP_INTERMEDIARIO_PSP_SCONOSCIUTO. Errore riportato in caso il broker psp coincidente con i dati forniti in input non sia presente nei dati ottenuti da config-cache\n **ODP-005** | *Bad Request* | ODP_INTERMEDIARIO_PSP_DISABILITATO. Errore riportato in caso il broker psp coincidente con l’id fornito in input risulti disabilitato\n **ODP-006** | *Unauthorized* | ODP_AUTENTICAZIONE. Errore di autenticazione rispetto ai dati forniti\n **ODP-007** | *Forbidden* | ODP_AUTORIZZAZIONE. Errore di autorizzazione rispetto ai dati forniti\n **ODP-008** | *Bad Request* | ODP_SEMANTICA. Errore fornito in caso della presenza di casi d’invalidità semantica nei dati del flusso di verifica\n **ODP-009** | *Not Found* | ODP_STAZIONE_INT_PA_SCONOSCIUTA. Errore forninca in caso di assenza associazione stazione e PA\n **ODP-0099** | *Bad Request* | ODP_STAZIONE_INT_PA_DISABILITATA. Errore riportato in caso la stazione coincidente con l’id fornito in input risulti disabilitato\n **ODP-010** | *Service Unavailable* | ODP_STAZIONE_INT_PA_IRRAGGIUNGIBILE. Errore fornito in caso d’irraggiungibilità della stazione\n **ODP-011** | *Bad Request* | ODP_STAZIONE_INT_PA_SERVIZIO_NON_ATTIVO. Errore fornito in caso di servizio non attivo\n **ODP-012** | *Internal Server Error* | ODP_STAZIONE_INT_PA_TIMEOUT. Errore fornito in caso di timeout della stazione\n **ODP-013** | *Internal Server Error* | ODP_ERRORE_EMESSO_DA_PAA. Errore fornito in caso di errori da PAA\n **ODP-014** | *Bad Request* | ODP_STAZIONE_INT_PA_ERRORE_RESPONSE. Errore fornito in caso di risposta KO dalla stazione\n **ODP-015** | *Bad Request* | ODP_PSP_NAV_NOT_NMU. Errore fornito nel caso in cui il nav non sia valido per il flusso OdP\n **ODP-016** | *Bad Request* | ODP_SYSTEM_ERROR Codice d’errore generico\n **ODP-017** | *Internal Server Error* | ODP_SYSTEM_ERROR. Codice d’errore generico\n **ODP-018** | *Bad Request* | ODP_INTERMEDIARIO_PA_DISABILITATO\n **ODP-019** | *Not Found* | ODP_INTERMEDIARIO_PA_SCONOSCIUTO\n **ODP-020** | *Bad Request* | ODP_DOMINIO_DISABILITATO\n **ODP-021** | *Not Found* | ODP_DOMINIO_SCONOSCIUTO \n\n </details> \n",
"termsOfService" : "https://www.pagopa.gov.it/",
"version" : "0.4.2"
},
"servers": [
{
"url": "${host}/quarkus-template/api/v1 - APIM"
"servers" : [ {
"url" : "http://localhost:8080",
"description" : "Localhost base URL"
}, {
"url" : "https://{host}/payment-options/service/v1",
"description" : "Base URL",
"variables" : {
"host" : {
"default" : "api.dev.platform.pagopa.it",
"enum" : [ "api.dev.platform.pagopa.it", "api.uat.platform.pagopa.it", "api.platform.pagopa.it" ]
}
}
],
"paths": {
"/info": {
"get": {
"tags": [
"Generic"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AppInfo"
} ],
"paths" : {
"/info" : {
"get" : {
"tags" : [ "Generic" ],
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/AppInfo"
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {}
"400" : {
"description" : "Bad Request",
"content" : {
"application/json" : { }
}
}
}
}
},
"/payment-options/organizations/{fiscal-code}/notices/{notice-number}": {
"get": {
"tags": [
"Payment Options Resource"
],
"summary": "Get payment options",
"description": "Retrieve the payment options related to the provided input",
"operationId": "getPaymentOptions",
"parameters": [
{
"name": "fiscal-code",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "notice-number",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "idPsp",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "X-Session-Id",
"in": "header",
"schema": {
"type": "string"
}
"/payment-options/organizations/{fiscal-code}/notices/{notice-number}" : {
"get" : {
"tags" : [ "Payment Options Resource" ],
"summary" : "Get payment options",
"description" : "Retrieve the payment options related to the provided input",
"operationId" : "getPaymentOptions",
"parameters" : [ {
"name" : "fiscal-code",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "notice-number",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "idPsp",
"in" : "query",
"schema" : {
"type" : "string"
}
}, {
"name" : "X-Session-Id",
"in" : "header",
"schema" : {
"type" : "string"
}
],
"responses": {
"500": {
"$ref": "#/components/responses/ErrorResponse500"
} ],
"responses" : {
"500" : {
"$ref" : "#/components/responses/ErrorResponse500"
},
"400": {
"$ref": "#/components/responses/ErrorResponse400"
"400" : {
"$ref" : "#/components/responses/ErrorResponse400"
},
"404": {
"$ref": "#/components/responses/ErrorResponse404"
"404" : {
"$ref" : "#/components/responses/ErrorResponse404"
},
"200": {
"description": "Success",
"content": {
"application/json": {}
"200" : {
"description" : "Success",
"content" : {
"application/json" : { }
}
}
}
}
}
},
"components": {
"schemas": {
"AppInfo": {
"type": "object",
"properties": {
"name": {
"type": "string"
"components" : {
"schemas" : {
"AppInfo" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"version": {
"type": "string"
"version" : {
"type" : "string"
},
"environment": {
"type": "string"
"environment" : {
"type" : "string"
}
}
},
"ErrorResponse": {
"type": "object",
"properties": {
"httpStatusCode": {
"format": "int32",
"type": "integer",
"example": 500
"ErrorResponse" : {
"type" : "object",
"properties" : {
"httpStatusCode" : {
"format" : "int32",
"type" : "integer",
"example" : 500
},
"httpStatusDescription": {
"type": "string",
"example": "Internal Server Error"
"httpStatusDescription" : {
"type" : "string",
"example" : "Internal Server Error"
},
"errorMessage": {
"type": "string",
"example": "An unexpected error has occurred. Please contact support."
"errorMessage" : {
"type" : "string",
"example" : "An unexpected error has occurred. Please contact support."
},
"appErrorCode": {
"type": "string",
"example": "ODP-<ERR_ID>"
"appErrorCode" : {
"type" : "string",
"example" : "ODP-<ERR_ID>"
},
"timestamp": {
"format": "int64",
"type": "integer",
"example": 1724425035
"timestamp" : {
"format" : "int64",
"type" : "integer",
"example" : 1724425035
},
"dateTime": {
"type": "string",
"example": "2024-08-23T14:57:15.635528"
"dateTime" : {
"type" : "string",
"example" : "2024-08-23T14:57:15.635528"
}
}
}
},
"responses": {
"ErrorResponse400": {
"description": "Default app exception for status 400",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
"responses" : {
"ErrorResponse400" : {
"description" : "Default app exception for status 400",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ErrorResponse"
}
}
}
},
"ErrorResponse404": {
"description": "Default app exception for status 404",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
"ErrorResponse404" : {
"description" : "Default app exception for status 404",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ErrorResponse"
}
}
}
},
"ErrorResponse500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
"ErrorResponse500" : {
"description" : "Internal Server Error",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ErrorResponse"
}
}
}
}
},
"securitySchemes": {
"ApiKey": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key"
"securitySchemes" : {
"ApiKey" : {
"type" : "apiKey",
"name" : "Ocp-Apim-Subscription-Key",
"in" : "header"
}
}
}
}
}
18 changes: 17 additions & 1 deletion src/main/java/it/gov/pagopa/payment/options/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
import jakarta.ws.rs.core.MediaType;
import org.eclipse.microprofile.openapi.annotations.Components;
import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn;
import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType;
import org.eclipse.microprofile.openapi.annotations.info.Info;
import org.eclipse.microprofile.openapi.annotations.media.Content;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme;
import org.eclipse.microprofile.openapi.annotations.servers.Server;
import org.eclipse.microprofile.openapi.annotations.servers.ServerVariable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -26,6 +29,7 @@
@SecurityScheme(
securitySchemeName = "ApiKey",
apiKeyName = "Ocp-Apim-Subscription-Key",
in = SecuritySchemeIn.HEADER,
type = SecuritySchemeType.APIKEY)
},
responses = {
Expand Down Expand Up @@ -55,7 +59,19 @@
schema = @Schema(implementation = ErrorResponse.class)
))
}),
info = @Info(title = "Payments Options Services", version = "${quarkus.application.version}"))
info = @Info(
title = "Payments Options Services",
version = "",
description = "placeholder-for-replace"),
servers = {
@Server(url = "http://localhost:8080", description = "Localhost base URL"),
@Server(url = "https://{host}/payment-options/service/v1", description = "Base URL",
variables = {
@ServerVariable(name = "host",
enumeration = {"api.dev.platform.pagopa.it", "api.uat.platform.pagopa.it", "api.platform.pagopa.it"},
defaultValue = "api.dev.platform.pagopa.it")})
}
)
@Startup
@QuarkusMain
public class App extends Application {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package it.gov.pagopa.payment.options.resources;

import io.vertx.core.cli.annotations.Hidden;
import it.gov.pagopa.payment.options.models.clients.creditorInstitution.PaymentOptionsResponse;
import it.gov.pagopa.payment.options.services.PaymentOptionsService;
import jakarta.inject.Inject;
Expand All @@ -18,6 +17,7 @@
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponses;
import org.jboss.resteasy.reactive.RestResponse;

import java.util.UUID;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ quarkus.smallrye-openapi.info-title=${quarkus.application.title} (${quarkus.appl
%dev.quarkus.smallrye-openapi.info-title=${quarkus.application.title} (DEV)
%test.quarkus.smallrye-openapi.info-title=${quarkus.application.title} (TEST)
%docker.quarkus.smallrye-openapi.info-title=${quarkus.application.title} (DOCKER)
quarkus.smallrye-openapi.info-description=${quarkus.application.title} description
quarkus.smallrye-openapi.info-version=${quarkus.application.version}
quarkus.smallrye-openapi.info-terms-of-service=https://www.pagopa.gov.it/
# TODO modify project
quarkus.smallrye-openapi.servers=\\$\{host\}/quarkus-template/api/v1 - APIM
# Path for the Swagger endpoint and file
quarkus.swagger-ui.path=/swagger
quarkus.smallrye-openapi.path=/openapi.json
Expand Down
Loading

0 comments on commit 6d83189

Please sign in to comment.