-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.yaml
632 lines (627 loc) · 21.6 KB
/
index.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
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# Copyright 2020 - 2024 PeopleWare n.v.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
openapi: 3.1.0
info:
title: ppwcode openapi demonstration
description: >-
Collection of common OpenAPI 3 specs
version: 12.0.0
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
contact:
name: PeopleWare n.v.
email: [email protected]
url: 'https://www.peopleware.be/'
servers:
- url: 'https://www.ppwcode.org/openapi/common'
description: Dummy endpoint. There is nothing here.
tags:
- name: Immutable data
x-traitTag: true
description:
$ref: 'resource/immutable.md'
- name: Caching
x-traitTag: true
description:
$ref: 'resource/caching.md'
- name: Lists
x-traitTag: true
description:
$ref: 'resource/paging.md'
- name: Canonical and fully qualified URI
x-traitTag: true
description:
$ref: 'string/canonical-and-fq-uri.md'
- name: Determining the build number of service dependencies to interact with
x-traitTag: true
description:
$ref: 'resource/determining-build-number.md'
- name: Search and to-many associations
x-traitTag: true
description:
$ref: 'resource/search-and-to-many-associations.md'
security:
- OAuth2:
- use
paths:
/health:
parameters:
- $ref: 'parameters/forceError.yaml'
- $ref: 'parameters/flowId.yaml'
- $ref: 'parameters/mode.yaml'
- $ref: 'oauth2/authorization.yaml'
get:
summary: Health of the API
description: >-
Returns `200` when a superficial check of the API, service, and its resources says it is healthy. A `470` means
the system is still reachable, but determines itself that it is not in good health. If the system is no longer
reachable, or fatally hampered, expect a `500` or any other error.
operationId: healthGet
responses:
'200':
description: >-
The service was reached, and it deemed itself healthy.
headers:
x-flow-id:
required: true
schema:
$ref: 'id/UUID.yaml'
x-mode:
required: true
schema:
$ref: 'id/mode.yaml'
cache-control:
required: true
schema:
$ref: 'resource/cacheControlNoCache.yaml'
# no vary necessary, because no-cache
x-date:
required: true
schema:
$ref: 'resource/date.yaml'
content:
application/json:
schema:
$ref: '#/components/schemas/health'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
'470':
description: >-
The service was reached, but some of its dependencies are not healthy. The service should not be used.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/getNoCache'
content:
application/json:
schema:
$ref: '#/components/schemas/health'
/demonstration/{crn}/{label}/{persistenceId}:
parameters:
- $ref: 'parameters/forceError.yaml'
- $ref: 'parameters/flowId.yaml'
- $ref: 'parameters/mode.yaml'
- $ref: 'parameters/crn.yaml'
- $ref: 'parameters/label.yaml'
- $ref: 'parameters/persistenceId.yaml'
- $ref: 'oauth2/authorization.yaml'
get:
summary: Demonstration of a list
description: use of page control query parameters
operationId: demonstrationList
parameters:
- $ref: 'parameters/at.yaml'
- $ref: 'parameters/page.yaml'
- $ref: 'parameters/perPage.yaml'
responses:
'200':
x-summary: The page was found
description: We get a list of references
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/getPrivateDynamicAt'
content:
application/json:
schema:
type: object
required:
- hrefs
- href
properties:
hrefs:
type: array
items:
type: string
format: uri
example: ../a/reference?at=2021-01-19T17:14:18.482Z
href:
$ref: 'resource/PagingHref.yaml'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
'404':
x-summary: The requested page never existed, or did not exist yet at `at`
description: >-
Probably, the page that was requested was past the last page, i.e., the number of items in the list is less
than or equal to `per_page * (page - 1)`. E.g., with 113 entries, the last page with `per_page = 20`, is
page 6. A request for page 7 results in a `404`.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/getPrivateDynamicAt'
post:
summary: Demonstration of common specs for `POST`
description: Every common spec is mentioned here.
operationId: demonstrationPost
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
responses:
'201':
x-summary: The resource was created with the given information
description: Every common spec is mentioned here. The `201` response shows `readOnly` properties.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/post201'
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
/demonstration/{crn}/{label}/{persistenceId}/{id}:
parameters:
- $ref: 'parameters/forceError.yaml'
- $ref: 'parameters/flowId.yaml'
- $ref: 'parameters/mode.yaml'
- $ref: 'parameters/crn.yaml'
- $ref: 'parameters/label.yaml'
- $ref: 'parameters/persistenceId.yaml'
- $ref: 'oauth2/authorization.yaml'
- name: id
in: path
description: id of the resource
schema:
$ref: 'id/UUID.yaml'
get:
summary: Demonstration of common specs for `GET`
description: Every common spec is mentioned here.
operationId: demonstrationGet
parameters:
- $ref: 'parameters/at.yaml'
responses:
'200':
x-summary: The resource exists
description: Every common spec is mentioned here. The `200` response shows `readOnly` properties.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/getPrivateDynamicAt'
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
'404':
$ref: 'resource/404At.yaml'
put:
summary: Demonstration of common specs for `PUT`
description: >-
Every common spec is mentioned here. The request body does not show `readOnly` properties.
operationId: demonstrationPut
parameters:
- $ref: 'parameters/optimisticLocking.yaml'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
responses:
'200':
x-summary: The resource was updated
description: Every common spec is mentioned here. The `200` response shows `readOnly` properties.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/put'
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
'404':
$ref: 'resource/404Put.yaml'
'412':
x-summary: Optimistic locking failed
description: >-
The date-time provided in the request header `if-unmodified-since` was not the most recent for the resource.
The body contains the most recent version of the resource, on which the client can base a retry.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/put'
content:
application/json:
schema:
# NOTE: replace with the correct schema
$ref: '#/components/schemas/resource'
/demonstration/{crn}/{label}/{persistenceId}/{id}/history:
parameters:
- $ref: 'parameters/forceError.yaml'
- $ref: 'parameters/flowId.yaml'
- $ref: 'parameters/mode.yaml'
- $ref: 'parameters/crn.yaml'
- $ref: 'parameters/label.yaml'
- $ref: 'parameters/persistenceId.yaml'
- $ref: 'oauth2/authorization.yaml'
- name: id
in: path
description: id of the resource
schema:
$ref: 'id/UUID.yaml'
get:
summary: Demonstration of common specs for `GET` resource history
description: A list of the different times at which the resource's information was changed.
operationId: demonstrationGetHistory
responses:
'200':
x-summary: The resource exists
description: >-
A list of the different times at which the resource's information was changed, ordered from most to least
recent, with links to retrieve that version of the information. Changes `< x-date` are included.
This call does not use paging, because we expect less than 50 changes to the information of the resource.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/getPrivateDynamic'
content:
application/json:
schema:
$ref: 'resource/History.yaml'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
'404':
$ref: 'resource/404Get.yaml'
/demonstration/{crn}/{label}/{persistenceId}/{id}/search-document:
parameters:
- $ref: 'parameters/forceError.yaml'
- $ref: 'parameters/flowId.yaml'
- $ref: 'parameters/mode.yaml'
- $ref: 'parameters/crn.yaml'
- $ref: 'parameters/label.yaml'
- $ref: 'parameters/persistenceId.yaml'
- $ref: 'oauth2/authorization.yaml'
- name: id
in: path
description: id of the resource
schema:
$ref: 'id/UUID.yaml'
get:
summary: Demonstration of common specs for `GET` search document
description: >-
Document to be indexed by search engine. Deprecated. Please use version 2.
operationId: demonstrationGetSearchDocument
deprecated: true
responses:
'200':
x-summary: The resource exists
description: Versioned. Has a `href`.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/getNoCache'
content:
application/json:
schema:
$ref: '#/components/schemas/searchDocument'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
'404':
$ref: 'resource/404NoCache.yaml'
/demonstration/{crn}/{label}/{persistenceId}/{id}/2/search-document:
parameters:
- $ref: 'parameters/forceError.yaml'
- $ref: 'parameters/flowId.yaml'
- $ref: 'parameters/mode.yaml'
- $ref: 'parameters/crn.yaml'
- $ref: 'parameters/label.yaml'
- $ref: 'parameters/persistenceId.yaml'
- $ref: 'oauth2/authorization.yaml'
- name: id
in: path
description: id of the resource
schema:
$ref: 'id/UUID.yaml'
get:
summary: Demonstration of common specs for `GET` search document
description: Document to be indexed by search engine
operationId: demonstrationGetSearchDocument2
responses:
'200':
x-summary: The resource exists
description: Versioned.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/getNoCache'
content:
application/json:
schema:
$ref: '#/components/schemas/searchDocument2'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
'404':
$ref: 'resource/404NoCache.yaml'
/demonstration/search:
parameters:
- $ref: 'parameters/forceError.yaml'
- $ref: 'parameters/flowId.yaml'
- $ref: 'parameters/mode.yaml'
- $ref: 'oauth2/authorization.yaml'
- in: query
name: searchTerm
required: true
description: >-
Text to search for with a fuzzy search in all indexed fields. Trimmed.
schema:
type: string
minLength: 1
example: find%20me
- $ref: 'parameters/page.yaml'
- $ref: 'parameters/perPage.yaml'
get:
summary: Demonstration of fuzzy search
description: >-
Return links to resource that have something to do with `searchTerm`, and information for humans to recognize
the found items.
operationId: demonstrationGetSearchResults
responses:
'200':
x-summary: The request page exists
description: >-
The found resources are returned with paging.
headers:
$ref: 'resource/CommonResponseHeaders.yaml#/getNoCache'
content:
application/json:
schema:
$ref: 'resource/SearchResults.yaml'
'400':
$ref: 'resource/400.yaml'
'401':
$ref: 'oauth2/401.yaml'
'403':
$ref: 'oauth2/403.yaml'
'404':
$ref: 'resource/404NoCache.yaml'
components:
securitySchemes:
OAuth2:
type: oauth2
description: Some OAuth2 authNZ
flows:
authorizationCode:
authorizationUrl: https://api.example.com/oauth2/authorize
tokenUrl: https://api.example.com/oauth2/token
scopes:
use: use the api
clientCredentials:
tokenUrl: https://api.example.com/oauth2/token
scopes:
use: use the api
schemas:
health:
allOf:
- $ref: 'resource/StructureVersion1.yaml'
- $ref: 'health/Health.yaml'
- type: object
required:
- dependency
properties:
dependency:
$ref: 'health/Status.yaml'
resource:
allOf:
- $ref: 'resource/StructureVersion2.yaml'
- $ref: 'resource/Audited.yaml'
- type: object
required:
- location
- href
properties:
human:
type: object
properties:
gender:
$ref: 'human/Gender.yaml'
id:
type: object
properties:
naturalPerson:
type: object
properties:
be:
type: object
properties:
inss:
$ref: 'id/naturalPerson/be/INSS.yaml'
legalPerson:
type: object
properties:
be:
type: object
properties:
crn:
$ref: 'id/legalPerson/be/CRN.yaml'
sigedis:
type: object
properties:
sigedisId:
$ref: 'id/sigedis/SigedisId.yaml'
sigedisRegistrantId:
$ref: 'id/sigedis/SigedisRegistrantId.yaml'
sigedisRegistrantRegulationIdentification:
$ref: 'id/sigedis/SigedisRegistrantRegulationIdentification.yaml'
uuid:
$ref: 'id/UUID.yaml'
mode:
$ref: 'id/mode.yaml'
accountId-readOnly:
$ref: 'id/AccountId.yaml'
location:
type: object
properties:
address:
$ref: 'location/Address.yaml'
country:
$ref: 'location/Country.yaml'
money:
type: object
properties:
currencyCode:
$ref: 'money/CurrencyCode.yaml'
monetaryValue:
$ref: 'money/MonetaryValue.yaml'
negativeMonetaryValue:
$ref: 'money/NegativeMonetaryValue.yaml'
nonPositiveMonetaryValue:
$ref: 'money/NonPositiveMonetaryValue.yaml'
nonNegativeMonetaryValue:
$ref: 'money/NonNegativeMonetaryValue.yaml'
positiveMonetaryValue:
$ref: 'money/PositiveMonetaryValue.yaml'
baseMoneyAmount:
$ref: 'money/BaseMoneyAmount.yaml'
moneyAmount:
$ref: 'money/MoneyAmount.yaml#/schema'
monetaryValue2:
$ref: 'money/MonetaryValue2.yaml'
oauth2:
type: object
properties:
bearerAccessToken:
$ref: 'oauth2/BearerAccessToken.yaml'
wwwAuthenticate:
$ref: 'oauth2/WWWAuthenticate.yaml'
string:
type: object
properties:
canonicalURI:
$ref: 'string/CanonicalURI.yaml'
canonicalURIWithKnowledgeTime:
$ref: 'string/CanonicalURIWithKnowledgeTime.yaml'
cleanedString:
$ref: 'string/CleanedString.yaml'
language:
$ref: 'string/Language.yaml'
relativeURI:
$ref: 'string/RelativeURI.yaml'
telephoneNumber:
$ref: 'string/TelephoneNumber.yaml'
trimmedString:
$ref: 'string/TrimmedString.yaml'
number:
type: object
properties:
decimal:
$ref: 'number/Decimal.yaml'
time:
type: object
properties:
dateTime:
$ref: 'time/DateTime.yaml'
changeDateTime:
$ref: 'time/ChangeDateTime.yaml'
dayDate:
$ref: 'time/DayDate.yaml'
month:
$ref: 'time/Month.yaml'
quarter:
$ref: 'time/Quarter.yaml'
year:
$ref: 'time/Year.yaml'
dayDateInterval:
$ref: 'time/DayDateInterval.yaml'
readOnly:
type: string
readOnly: true
description: >-
`readOnly` properties only appear in responses, not in request bodies
example: I am a read-only property
href:
allOf:
- $ref: 'resource/HREFHistorySearchable.yaml'
- example:
history: 123/history
searchDocument: 123/search-document
searchDocument:
allOf:
- $ref: 'resource/SearchDocument.yaml'
- type: object
properties:
content:
allOf:
- $ref: 'resource/SearchResultBase.yaml'
- type: object
required:
- interestingInfo
properties:
interestingInfo:
type: string
minLength: 1
example: 'look what I‘ve found'
searchDocument2:
allOf:
- $ref: 'resource/SearchDocument2.yaml'
- type: object
properties:
content:
allOf:
- $ref: 'resource/SearchDocumentContentBase2.yaml'
- type: object
required:
- interestingInfo
properties:
interestingInfo:
type: string
minLength: 1
example: 'look what I‘ve found'
# Token requests bodies listed explicitly here as workaround for https://github.com/Redocly/redoc/issues/862#issuecomment-491631228
# This is actually used in `money/MoneyAmount.yaml`.
baseMinorUnit0:
$ref: 'money/MoneyAmount.yaml#/components/schemas/baseMinorUnit0'
baseMinorUnit2:
$ref: 'money/MoneyAmount.yaml#/components/schemas/baseMinorUnit2'
baseMinorUnit3:
$ref: 'money/MoneyAmount.yaml#/components/schemas/baseMinorUnit3'
baseMinorUnit4:
$ref: 'money/MoneyAmount.yaml#/components/schemas/baseMinorUnit4'