-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefinitions.yaml
560 lines (547 loc) · 18.4 KB
/
definitions.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
# 2022-11-23T11:05:27
info:
description: |
OpenAPI 3 templates and definitions for implementing
interoperable APIs.
The work is ongoing, your feedback is greatly appreciated!
title: Interoperability components Italy
version: master
x-commit: c498a7383f73372f09bfefcd81fbdef0c7190fa5
x-date: 1669201527
openapi: 3.0.0
components:
headers:
Cache-Control:
description: |-
Cache usage SHOULD be extensively detailed in the `description` property
to avoid data leaks or the usage of stale data.
This rule should ensure in some way that the api provider
documented extensively the cache usage to avoid data leaks
or usage of stale data.
For now this ruleset tests:
* the presence of following keywords
in the `description`: `max-age`, `private`, `no-store`, `no-cache`.
* that one and only one between Expires and Cache-Control is used.
`Cache-Control` and `Expires` should not be used in conjuction,
because `Cache-Control` overrides `Expires` when `max-age` is set.
Instead if neither `Cache-Control` or `Expires` are set, clients MAY use euristic cache
like described in RFC7234.
schema:
example: no-store
externalDocs:
url: https://datatracker.ietf.org/doc/html/rfc7234
pattern: '[a-zA-Z0-9=;" -]{,255}'
type: string
Location:
description: |-
In some responses, this header references the
primary resource created.
It is used for redirections too.
See https://tools.ietf.org/html/rfc7231#section-7.1.2
schema:
format: url
maxLength: 4096
type: string
Retry-After:
description: |-
Retry contacting the endpoint *at least* after seconds.
See https://tools.ietf.org/html/rfc7231#section-7.1.3
schema:
format: int32
maximum: 186400
minimum: 0
type: integer
Sunset:
description: The Sunset HTTP response header field, indicates that a URI is
likely to become unresponsive at a specified point in the future. It also
defines a sunset link relation type that allows linking to resources providing
information about an upcoming resource or service sunset.
schema:
example: Sun, 06 Nov 1994 08:49:37 GMT
externalDocs:
url: https://tools.ietf.org/html/rfc7231#appendix-D
format: HTTP-date
maxLength: 30
type: string
X-Content-Type-Options:
description: |-
The X-Content-Type-Options response HTTP header indicates
that the MIME types advertised in the Content-Type headers should not be changed and be followed.
Site security testers usually expect this header to be set to `nosniff`.
schema:
enum:
- nosniff
example: nosniff
externalDocs:
url: https://fetch.spec.whatwg.org/#x-content-type-options-header
type: string
X-RateLimit-Limit:
description: The number of allowed requests in the current period
schema:
format: int32
maximum: 1000000
minimum: 0
type: integer
X-RateLimit-Remaining:
description: The number of remaining requests in the current period
schema:
format: int32
maximum: 1000000
minimum: 0
type: integer
X-RateLimit-Reset:
description: The number of seconds left in the current period
schema:
format: int32
maximum: 186400
minimum: 0
type: integer
parameters:
Etag:
description: |
The RFC7232 ETag header field in a response provides the current entity-
tag for the selected resource. An entity-tag is an opaque identifier for
different versions of a resource over time, regardless whether multiple
versions are valid at the same time. An entity-tag consists of an opaque
quoted string, possibly prefixed by a weakness indicator.
example: W/"xy", "5", "7da7a728-f910-11e6-942a-68f728c1ba70"
in: header
name: Etag
required: false
schema:
maxLength: 1024
type: string
IfMatch:
description: |
The RFC7232 If-Match header field in a request requires the server to
only operate on the resource that matches at least one of the provided
entity-tags. This allows clients express a precondition that prevent
the method from being applied if there have been any changes to the
resource.
example: '"5", "7da7a728-f910-11e6-942a-68f728c1ba70"'
in: header
name: If-Match
required: false
schema:
maxLength: 1024
type: string
IfNoneMatch:
description: |
The RFC7232 If-None-Match header field in a request requires the server
to only operate on the resource if it does not match any of the provided
entity-tags. If the provided entity-tag is `*`, it is required that the
resource does not exist at all.
example: '"7da7a728-f910-11e6-942a-68f728c1ba70", *'
in: header
name: If-None-Match
required: false
schema:
maxLength: 1024
type: string
citizen:
description: testme
in: query
name: citizen
schema:
$ref: '#/components/schemas/Person'
cursor:
description: An opaque identifier that points to the next item in the collection.
example: 01BX9NSMKVXXS5PSP2FATZM123
in: query
name: cursor
schema:
maxLength: 1024
type: string
fields:
description: Fields to retrieve
in: query
name: fields
schema:
maxLength: 4096
type: string
limit:
description: How many items to return at one time (max 100)
in: query
name: limit
schema:
format: int32
maximum: 100
minimum: 0
type: integer
offset:
description: The zero-ary offset index into the results
in: query
name: offset
schema:
default: 0
format: int32
maximum: 1e10
minimum: 0
type: integer
q:
description: Search query term
in: query
name: q
schema:
maxLength: 2048
type: string
sort:
description: Sorting order
in: query
name: sort
schema:
example: +name
maxLength: 1024
type: string
responses:
400BadRequest:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Bad Request
404NotFound:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Not Found
429TooManyRequests:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Too many requests
headers:
Retry-After:
$ref: '#/components/headers/Retry-After'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Reset:
$ref: '#/components/headers/X-RateLimit-Reset'
503ServiceUnavailable:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Service Unavailable
headers:
Retry-After:
$ref: '#/components/headers/Retry-After'
default:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Unexpected error
schemas:
Address:
properties:
city:
description: https://w3id.org/italia/onto/CLV/City
maxLength: 128
type: string
country:
description: https://w3id.org/italia/onto/CLV/Country
maxLength: 128
type: string
province:
description: https://w3id.org/italia/onto/CLV/Province
maxLength: 3
type: string
region:
maxLength: 128
type: string
zip_code:
maxLength: 6
type: string
required:
- city
- province
- country
type: object
x-jsonld-context:
'@vocab': https://w3id.org/italia/onto/CLV/
city: hasCity
country:
'@context':
'@base': http://publications.europa.eu/resource/authority/country/
'@id': hasCountry
'@type': '@id'
province:
'@context':
'@base': https://w3id.org/italia/data/identifiers/provinces-identifiers/vehicle-code/
'@id': hasProvince
'@type': '@id'
region:
'@context':
'@base': https://w3id.org/italia/controlled-vocabulary/territorial-classifications/regions/
'@id': hasRegion
'@type': '@id'
zip_code: postCode
x-jsonld-type: https://w3id.org/italia/onto/Address
Amount:
description: |
ISO20022: Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party.
example: '12.25'
maxLength: 35
minLength: 1
pattern: ^\-{0,1}[0-9]{1,13}(\.[0-9]{0,5}){0,1}$
type: string
Coordinates:
description: |-
Geographic coordinates of a point. The names "lat" and "long" are inherited from the clvapit.
Example URL: http://dati.beniculturali.it/lodview/mibact/luoghi/resource/Geometry/Coordinate_geografiche_della_sede_di_Gallerie_degli_Uffizi_-_Corridoio_Vasariano_20440.html
properties:
lat:
$ref: '#/components/schemas/Latitude'
long:
$ref: '#/components/schemas/Longitude'
required:
- lat
- long
CurrencyCode:
description: |
Specifies the currency of the amount or of the account.
A code allocated to a currency by a Maintenance Agency under an international identification scheme, as described in the latest edition of the international standard ISO 4217 "Codes for the representation of currencies and funds".
example: EUR
maxLength: 3
pattern: ^[A-Z]{3,3}$
type: string
Latitude:
description: |-
Latitude of a point expressed in:
* the ETRS89 system for Italian and European territories
* and in WGS84 for the others.
example: 45.492599
externalDocs:
url: http://dati.gov.it/onto/clvapit#long
format: double
maximum: 90
minimum: -90
type: number
LatitudeString:
description: |-
Latitude of a point expressed in:
* the ETRS89 system for Italian and European territories
* and in WGS84 for the others.
Value is serialized as a string. The associated numeric value must be
between -90 and 90.
The string value is safe from floating-point aritmetic errors.
example: '45.492599412312331'
type: string
Location:
properties:
city:
description: https://w3id.org/italia/onto/CLV/City
maxLength: 128
type: string
country:
description: https://w3id.org/italia/onto/CLV/Country
maxLength: 128
type: string
province:
description: https://w3id.org/italia/onto/CLV/Province
maxLength: 3
type: string
region:
maxLength: 128
type: string
zip_code:
maxLength: 6
type: string
required:
- country
type: object
x-jsonld-context:
'@vocab': https://w3id.org/italia/onto/CLV/
city: hasCity
country:
'@context':
'@base': http://publications.europa.eu/resource/authority/country/
'@id': hasCountry
'@type': '@id'
province:
'@context':
'@base': https://w3id.org/italia/data/identifiers/provinces-identifiers/vehicle-code/
'@id': hasProvince
'@type': '@id'
region:
'@context':
'@base': https://w3id.org/italia/controlled-vocabulary/territorial-classifications/regions/
'@id': hasRegion
'@type': '@id'
zip_code: postCode
x-jsonld-type: https://w3id.org/italia/onto/CLV/Feature
Longitude:
description: |-
Longitude of a point expressed in:
* the ETRS89 system for Italian and European territories
* and in WGS84 for the others.
example: 9.19289
externalDocs:
url: http://dati.gov.it/onto/clvapit#long
format: double
maximum: 180
minimum: -180
type: number
LongitudeString:
description: |-
Latitude of a point expressed in:
* the ETRS89 system for Italian and European territories
* and in WGS84 for the others.
Value is serialized as a string. The associated numeric value must be
between -180 and 180.
The string value is safe from floating-point aritmetic errors.
example: '9.192894141231231'
type: string
Money:
description: |
An amount of money in a given currency.
example:
amount: '12.25'
currency: EUR
properties:
amount:
$ref: '#/components/schemas/Amount'
currency:
$ref: '#/components/schemas/CurrencyCode'
required:
- currency
- amount
type: object
Person:
externalDocs:
url: https://w3id.org/italia/onto/CPV
properties:
birth_place:
$ref: '#/components/schemas/Location'
date_of_birth:
format: date
type: string
education:
maxLength: 3
type: string
family_name:
maxLength: 255
type: string
given_name:
maxLength: 255
type: string
residence:
$ref: '#/components/schemas/Address'
tax_code:
$ref: '#/components/schemas/TaxCode'
type: object
x-jsonld-context:
'@vocab': https://w3id.org/italia/onto/CPV/
birth_place:
'@context':
'@vocab': https://w3id.org/italia/onto/CLV/
city: hasCity
country:
'@context':
'@base': http://publications.europa.eu/resource/authority/country/
'@id': hasCountry
'@type': '@id'
province:
'@context':
'@base': https://w3id.org/italia/data/identifiers/provinces-identifiers/vehicle-code/
'@id': hasProvince
'@type': '@id'
'@id': birthPlace
date_of_birth: dateOfBirth
education: hasLevelOfEducation
family_name: familyName
given_name: givenName
residence:
'@context':
'@vocab': https://w3id.org/italia/onto/CLV/
city: hasCity
country:
'@context':
'@base': http://publications.europa.eu/resource/authority/country/
'@id': hasCountry
'@type': '@id'
province:
'@context':
'@base': https://w3id.org/italia/data/identifiers/provinces-identifiers/vehicle-code/
'@id': hasProvince
'@type': '@id'
region:
'@context':
'@base': https://w3id.org/italia/controlled-vocabulary/territorial-classifications/regions/
'@id': hasRegion
'@type': '@id'
zip_code: postCode
'@id': residentIn
x-jsonld-type: https://w3id.org/italia/onto/CPV/Person
Problem:
additionalProperties: false
description: |-
This schema describes RFC7807 Problem Details for HTTP APIs.
The specification is intentionally flexible, and allows to adapt
the schema adding further properties, or not enforcing any of the properties
below.
To make this schema safe by default, additionalProperties are forbidden though.
In case you need them, you can either re-define Problem or extend it
using `allOf`.
properties:
detail:
description: |
A human readable explanation specific to this occurrence of the
problem. You MUST NOT expose internal informations, personal
data or implementation details through this field.
`detail` supports localized patterns whereas `title` pattern is only in ascii.
example: Request took too long to complete.
maxLength: 4096
pattern: ^.{0,1024}$
type: string
instance:
description: |
An absolute URI that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.
format: uri
maxLength: 2048
type: string
status:
description: |
The HTTP status code generated by the origin server for this occurrence
of the problem.
example: 503
exclusiveMaximum: true
format: int32
maximum: 600
minimum: 100
type: integer
title:
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): the expressed pattern does not support unicode characters.
example: Service Unavailable
maxLength: 64
pattern: ^[ -~]{0,64}$
type: string
type:
default: about:blank
description: |
An absolute URI that identifies the problem type. When dereferenced,
it SHOULD provide human-readable documentation for the problem type
(e.g., using HTML).
example: https://tools.ietf.org/html/rfc7231#section-6.6.4
format: uri
maxLength: 2048
type: string
type: object
TaxCode:
description: Il codice fiscale.
example: RSSMRA75L01H501A
externalDocs:
url: https://w3id.org/italia/onto/CPV/taxCode
maxLength: 16
minLength: 11
pattern: /^(?:(?:[B-DF-HJ-NP-TV-Z]|[AEIOU])[AEIOU][AEIOUX]|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[1256LMRS][\dLMNP-V])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[1-9MNP-V][\dLMNP-V]|[0L][1-9MNP-V]))[A-Z]$/i
type: string