From 19ef8a86007e6b5392eb40ec4347789010c97daa Mon Sep 17 00:00:00 2001 From: giomella Date: Thu, 7 Mar 2024 15:29:29 +0100 Subject: [PATCH] [VAS-800] updated openapi --- openapi/openapi.json | 171 ++++++++++++++++-- .../CreditorInstitutionController.java | 1 - 2 files changed, 156 insertions(+), 16 deletions(-) diff --git a/openapi/openapi.json b/openapi/openapi.json index 70fd7897..8f8a0110 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -513,6 +513,128 @@ } ] }, + "/creditorinstitutions": { + "post": { + "tags": [ + "Creditor Institutions" + ], + "summary": "Get the list of creditor institution business names", + "description": "Return a list of business name and tax code of creditor institutions, given the provided list of creditor institution tax codes", + "operationId": "getCreditorInstitutionNamesFromTaxCodes", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CreditorInstitutionInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } + } + }, + "429": { + "description": "Too many requests", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Service unavailable", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } + } + } + }, + "security": [ + { + "ApiKey": [] + }, + { + "Authorization": [] + } + ] + }, + "parameters": [ + { + "name": "X-Request-Id", + "in": "header", + "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema": { + "type": "string" + } + } + ] + }, "/creditorinstitutions/{creditorInstitutionCode}/applicationcodes": { "get": { "tags": [ @@ -1372,6 +1494,28 @@ }, "components": { "schemas": { + "ProblemJson": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status": { + "maximum": 600, + "minimum": 100, + "type": "integer", + "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format": "int32", + "example": 200 + }, + "detail": { + "type": "string", + "description": "A human readable explanation specific to this occurrence of the problem.", + "example": "There was an error processing the request" + } + } + }, "IbanDetails": { "type": "object", "properties": { @@ -1471,25 +1615,22 @@ } } }, - "ProblemJson": { + "CreditorInstitutionInfo": { + "required": [ + "business_name", + "creditor_institution_code" + ], "type": "object", "properties": { - "title": { + "business_name": { "type": "string", - "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" - }, - "status": { - "maximum": 600, - "minimum": 100, - "type": "integer", - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "format": "int32", - "example": 200 + "description": "The business name of the creditor institution", + "example": "Comune di Roma" }, - "detail": { + "creditor_institution_code": { "type": "string", - "description": "A human readable explanation specific to this occurrence of the problem.", - "example": "There was an error processing the request" + "description": "The tax code of the creditor institution", + "example": "02438750586" } } }, @@ -2143,4 +2284,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/controller/CreditorInstitutionController.java b/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/controller/CreditorInstitutionController.java index 04a7dbb9..65d56eac 100644 --- a/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/controller/CreditorInstitutionController.java +++ b/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/controller/CreditorInstitutionController.java @@ -283,7 +283,6 @@ public ResponseEntity getSegregationCodesFromCreditorInsti content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, array = @ArraySchema(schema = @Schema(implementation = CreditorInstitutionInfo.class)))), @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema())), - @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(schema = @Schema())), @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(schema = @Schema(implementation = ProblemJson.class))), @ApiResponse(responseCode = "429", description = "Too many requests", content = @Content(schema = @Schema())),