Advertisement
Guest User

verificaCodiceFiscale.yaml

a guest
Oct 2nd, 2023
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 10.92 KB | Software | 0 0
  1. #
  2. # Verifica validità codice fiscale
  3. x-commons:
  4.   ratelimit-headers: &ratelimit-headers
  5.     X-RateLimit-Limit:
  6.       $ref: '#/components/headers/X-RateLimit-Limit'
  7.     X-RateLimit-Remaining:
  8.       $ref: '#/components/headers/X-RateLimit-Remaining'
  9.     X-RateLimit-Reset:
  10.         $ref: '#/components/headers/X-RateLimit-Reset'
  11.   common-responses: &common-responses
  12.     '400':
  13.       $ref: '#/components/responses/400BadRequest'
  14.     '401':
  15.       $ref: '#/components/responses/401Unauthorized'
  16.     '429':
  17.       $ref: '#/components/responses/429TooManyRequests'
  18.     '503':
  19.       $ref: '#/components/responses/503ServiceUnavailable'
  20.     default:
  21.       $ref: '#/components/responses/default'
  22.  
  23. security:
  24.   - IBM-Client-Secret: []
  25.     IBM-Client-Id: []
  26.    
  27. openapi: 3.0.0
  28. info:
  29.   version: "1.0.0"
  30.  
  31.   title: |-
  32.     Verifica validità codice fiscale.
  33.   x-summary: >-
  34.     Verifica validità di codice fiscale di persona fisica e persona non fisica
  35.    
  36.   description: |
  37.    #### Documentazione
  38.     Questo servizio ritorna la validità di una dato codice fiscale descritta da
  39.     un campo di ritorno booleano nell oggetto json di response
  40.  
  41.     #### Note
  42.     Poiché il servizio effettua una verifica sul dato in input una
  43.     risposta verrà sempre ritornata con stato 200 anche se il codice fiscale
  44.     non fosse presente negli archivi.
  45.  
  46.     Nella risposta è presente un campo messaggio che riporta la stessa dizione
  47.     del servizio di verifica codice fiscale a libero accesso del sito istituzionale
  48.    
  49.     ##### Conformità con il modello di interoperabilità
  50.     L'Header di Throttling X-RateLimit-Reset non viene inviato in caso di https
  51.     status code 200, sarà presente solo in caso di 429
  52.  
  53.     #### Sicurezza
  54.     Pur essendo questa API di pubblico accesso, è richiesto l'invio delle
  55.     API Key che consentono all'infrastruttura di applicare le politiche di
  56.     throttling definite nell'ambito del piano sottoscritto
  57.      
  58.     #### Informazioni tecniche ed esempi
  59.  
  60.     Esempio:
  61.  
  62.     ```
  63.     curl --header "Content-Type: application/json" \
  64.          --request POST \
  65.          --data '{"codiceFiscale":"AAAZZZ00H00T000Z"}' \
  66.         https://agenziaentrate.gov.it/entrate/api/codice-fiscale/v0/verifica
  67.    
  68.     {
  69.       "codiceFiscale": "AAAZZZ00H00T000Z"
  70.       "valido": false,
  71.       "messaggio": "Codice fiscale non valido"
  72.     }
  73.     ```
  74.  
  75.   contact:
  76.     name: Agenzia delle Entrate
  77.     url: https://www.agenziaentrate.gov.it
  78.   x-audience:
  79.    - public
  80.   x-api-id: 5ca54741-8f62-4aad-ab79-13ae762920e3
  81.   license:
  82.     name: Apache 2.0
  83.     url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  84. tags:
  85.   - name: infrastructure
  86.     description: |-
  87.       Endpoint non autenticato per la verifica dello stato del servizio
  88.   - name: verifiche
  89.     description: |-
  90.       verifica la validità e l'esistenza della codice fiscale in input
  91. servers:
  92.   - description: Produzione
  93.     url: https://api.agenziaentrate.gov.it/entrate/api/codice-fiscale/v0
  94.  
  95.  
  96. paths:
  97.   /status:
  98.     get:
  99.       summary: Ritorna lo stato dell'applicazione.
  100.       description: |
  101.         Ritorna lo stato dell'applicazione: 200 se funziona correttamente
  102.         o un errore se l'applicazione è temporaneamente indisponibile
  103.         per manutenzione o per un problema tecnico.
  104.       operationId: get_status
  105.       tags:
  106.        - infrastructure
  107.       responses:
  108.         <<: *common-responses
  109.         '200':
  110.           description: |
  111.            Il server ha ritornato lo status. In caso di problemi
  112.             ritorna sempre un problem+json.
  113.           headers:
  114.             <<: *ratelimit-headers
  115.           content:
  116.             application/problem+json:
  117.               schema:
  118.                 $ref: '#/components/schemas/Problem'
  119.   /verifica:
  120.     post:
  121.       summary: Effettua una validazione del codice fiscale in input.
  122.       operationId: post_verifica_codiceFiscale
  123.       tags:
  124.        - verifiche
  125.       description: |
  126.        Ritorna informazioni circa la validità del codice fiscale in input
  127.       requestBody:
  128.         required: true
  129.         content:
  130.           application/json:
  131.             schema:
  132.               $ref: '#/components/schemas/Richiesta'
  133.             examples:
  134.               codiceFiscaleAlfanumerico:
  135.                 value:
  136.                   codiceFiscale: 'AAAZZZ00H00T000Z'
  137.               codiceFiscaleNumerico:
  138.                 value:
  139.                   codiceFiscale: '06363391001'
  140.              
  141.          
  142.       responses:
  143.         <<: *common-responses
  144.         '200':
  145.           description: |
  146.            Il server è riuscito a verificare la validità del codice fiscale.
  147.           # header di throttling sono obbligatori
  148.           headers:
  149.             <<: *ratelimit-headers
  150.           content:
  151.             application/json:
  152.               schema:
  153.                 $ref: '#/components/schemas/VerificaCodiceFiscale'
  154.               examples:   # Esempi per ogni casistica
  155.                 CodiceFiscaleValido:
  156.                   value:
  157.                     codiceFiscale: '06363391001'
  158.                     valido: true
  159.                     messaggio: "Codice fiscale valido"
  160.                 CodiceFiscaleValidoNonUtilizzabile:
  161.                   value:
  162.                     codiceFiscale: '***********'
  163.                     valido: true
  164.                     messaggio: "Codice fiscale valido, non più utilizzabile in quanto aggiornato in altro codice fiscale"
  165.                 CodiceFiscaleNonValidoAggiornatoInAltro:
  166.                   value:
  167.                     codiceFiscale: '***********'
  168.                     valido: false
  169.                     messaggio: "Codice fiscale non utilizzabile in quanto aggiornato in altro codice fiscale"
  170.                 CodiceFiscaleNonValido:
  171.                   value:
  172.                     codiceFiscale: 'AAAZZZ00H00T000Z'
  173.                     valido: false
  174.                     messaggio: "Codice fiscale non valido"
  175. components:
  176.   schemas:
  177.     Richiesta:
  178.       type: object
  179.       properties:
  180.         codiceFiscale:
  181.           $ref: '#/components/schemas/CodiceFiscale'
  182.  
  183.    
  184.     CodiceFiscale:
  185.       type: string
  186.       minLength: 11
  187.       maxLength: 16
  188.       pattern: '^[0-9]{11}|(?:^(?:[A-Z][AEIOU][AEIOUX]|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}(?:[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[15MR][\dLMNP-V]|[26NS][0-8LMNP-U])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM]|[AC-EHLMPR-T][26NS][9V])|(?:[02468LNQSU][048LQU]|[13579MPRTV][26NS])B[26NS][9V])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[1-9MNP-V][\dLMNP-V]|[0L][1-9MNP-V]))[A-Z]$)'
  189.      
  190.       example: '06363391001'
  191.       description: 'può assumere un valore alfanumerico di lunghezza 16 o numerico di lunghezza 11 (i.e. 06363391001)'
  192.    
  193.  
  194.     VerificaCodiceFiscale:
  195.       type: object
  196.       properties:
  197.         codiceFiscale:
  198.           $ref: '#/components/schemas/CodiceFiscale'
  199.         valido:
  200.           type: boolean
  201.           example: true
  202.         messaggio:
  203.           type: string
  204.           example: "Codice fiscale valido"
  205.           description: "messaggio congurente con il serivizio a libero accesso di verifica codice fiscale sul sito istituzionale"
  206.        
  207.  
  208.    
  209.     Problem:
  210.       properties:
  211.         detail:
  212.           description: |
  213.            A human readable explanation specific to this occurrence of the
  214.             problem. You MUST NOT expose internal informations, personal
  215.             data or implementation details through this field.
  216.           example: Request took too long to complete.
  217.           type: string
  218.         instance:
  219.           description: |
  220.            An absolute URI that identifies the specific occurrence of the problem.
  221.             It may or may not yield further information if dereferenced.
  222.           format: uri
  223.           type: string
  224.         status:
  225.           description: |
  226.            The HTTP status code generated by the origin server for this occurrence
  227.             of the problem.
  228.           example: 503
  229.           exclusiveMaximum: true
  230.           format: int32
  231.           maximum: 600
  232.           minimum: 100
  233.           type: integer
  234.         title:
  235.           description: |
  236.            A short, summary of the problem type. Written in english and readable
  237.             for engineers (usually not suited for non technical stakeholders and
  238.             not localized); example: Service Unavailable
  239.           type: string
  240.         type:
  241.           default: about:blank
  242.           description: |
  243.            An absolute URI that identifies the problem type.  When dereferenced,
  244.             it SHOULD provide human-readable documentation for the problem type
  245.             (e.g., using HTML).
  246.           format: uri
  247.           type: string
  248.       type: object
  249.   securitySchemes:
  250.       IBM-Client-Secret:
  251.         type: apiKey
  252.         description: ''
  253.         name: X-IBM-Client-Secret
  254.         in: header
  255.       IBM-Client-Id:
  256.         type: apiKey
  257.         description: ''
  258.         name: X-IBM-Client-Id
  259.         in: header
  260.  
  261.   headers:
  262.     Retry-After:
  263.       description: |-
  264.         Retry contacting the endpoint *at least* after seconds.
  265.         See https://tools.ietf.org/html/rfc7231#section-7.1.3
  266.       schema:
  267.         type: string
  268.     WWW-Authenticate:
  269.       description: |-
  270.         Auth realm=APIkey
  271.         See https://tools.ietf.org/html/rfc7235#section-4.1
  272.       schema:
  273.         type: string
  274.     X-RateLimit-Limit:
  275.       description: The number of allowed requests in the current period
  276.       schema:
  277.         type: string
  278.     X-RateLimit-Remaining:
  279.       description: The number of remaining requests in the current period
  280.       schema:
  281.         type: string
  282.     X-RateLimit-Reset:
  283.       description: The number of seconds left in the current period
  284.       schema:
  285.         type: string
  286.  
  287.   responses:
  288.     400BadRequest:
  289.       content:
  290.         application/problem+json:
  291.           schema:
  292.             $ref: '#/components/schemas/Problem'
  293.       description: Bad Request
  294.     401Unauthorized:
  295.       content:
  296.         application/problem+json:
  297.           schema:
  298.             $ref: '#/components/schemas/Problem'
  299.       headers:
  300.         WWW-Authenticate:
  301.           $ref: '#/components/headers/WWW-Authenticate'
  302.       description: Not authorized
  303.     403Forbidden:
  304.       description: Forbidden
  305.     404NotFound:
  306.       description: Not Found
  307.     429TooManyRequests:
  308.       description: Too many requests
  309.       headers:
  310.         Retry-After:
  311.           $ref: '#/components/headers/Retry-After'
  312.         X-RateLimit-Limit:
  313.           $ref: '#/components/headers/X-RateLimit-Limit'
  314.         X-RateLimit-Remaining:
  315.           $ref: '#/components/headers/X-RateLimit-Remaining'
  316.         X-RateLimit-Reset:
  317.           $ref: '#/components/headers/X-RateLimit-Reset'
  318.     503ServiceUnavailable:
  319.       content:
  320.         application/problem+json:
  321.           schema:
  322.             $ref: '#/components/schemas/Problem'
  323.       description: Service Unavailable
  324.       headers:
  325.         Retry-After:
  326.           $ref: '#/components/headers/Retry-After'
  327.     default:
  328.       description: Unexpected error
  329.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement