-
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.
chore: P4PU-188 added exception handler class (#6)
* P4PU-188 added ArcExceptionHandler, custom exception and tests * P4PU-188 removed ArcErrorDTO and custom exception, added openapi generator dependency and swagger * P4PU-188 updated openapi generator config * P4PU-188 cancelled modifies in application.yml * P4PU-188 updated exception handler and swagger * P4PU-188 updated swagger * P4PU-188 updated swagger
- Loading branch information
1 parent
c339e34
commit 2057543
Showing
5 changed files
with
153 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
pr: | ||
- develop | ||
- uat | ||
- main | ||
branches: | ||
include: | ||
- '*' | ||
|
||
pool: | ||
vmImage: ubuntu-22.04 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: pagopa-arc-be | ||
description: Api and Models | ||
version: 0.0.1 | ||
servers: | ||
- url: "http://localhost:8080/arc" | ||
description: Generated server url | ||
paths: | ||
/transactions: | ||
get: | ||
tags: | ||
- arc transactions | ||
summary: "Retrieve the paged transaction list from arc" | ||
operationId: getTransactionList | ||
parameters: | ||
- name: page | ||
in: query | ||
description: "Number of page required" | ||
required: false | ||
schema: | ||
type: integer | ||
format: int32 | ||
- name: size | ||
in: query | ||
description: "Number of items for page" | ||
required: false | ||
schema: | ||
type: integer | ||
format: int32 | ||
default: 10 | ||
- name: filter | ||
in: query | ||
description: "The field passed to filter the list of transactions" | ||
required: false | ||
schema: | ||
type: string | ||
example: payedByMe | ||
responses: | ||
'200': | ||
description: "Obtained transaction list" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/TransactionsListDTO' | ||
'401': | ||
description: "Wrong or missing function key" | ||
'429': | ||
description: "Too many Requests" | ||
'500': | ||
description: "Service unavailable" | ||
components: | ||
schemas: | ||
TransactionsListDTO: | ||
type: object | ||
properties: | ||
transactions: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/TransactionDTO' | ||
currentPage: | ||
type: integer | ||
format: int32 | ||
itemsForPage: | ||
type: integer | ||
format: int32 | ||
totalItems: | ||
type: integer | ||
format: int32 | ||
totalPages: | ||
type: integer | ||
format: int32 | ||
TransactionDTO: | ||
type: object | ||
properties: | ||
transactionId: | ||
type: string | ||
payeeName: | ||
type: string | ||
payeeTaxCode: | ||
type: string | ||
amount: | ||
type: integer | ||
format: int64 | ||
transactionDate: | ||
type: string | ||
format: date-time | ||
example: "2024-05-31T13:07:25Z" | ||
isCart: | ||
type: boolean | ||
payedByMe: | ||
type: boolean | ||
registeredToMe: | ||
type: boolean | ||
ErrorDTO: | ||
type: object | ||
required: | ||
- error | ||
properties: | ||
error: | ||
type: string | ||
enum: | ||
- generic_error | ||
- invalid_request | ||
error_description: | ||
type: string | ||
x-field-extra-annotation: "@com.fasterxml.jackson.annotation.JsonProperty(\"error_description\")" |
13 changes: 13 additions & 0 deletions
13
src/main/java/it/gov/pagopa/arc/exception/ExceptionHandler.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package it.gov.pagopa.arc.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.core.Ordered; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
||
@RestControllerAdvice | ||
@Slf4j | ||
@Order(Ordered.HIGHEST_PRECEDENCE) | ||
public class ExceptionHandler { | ||
|
||
} |
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