-
Notifications
You must be signed in to change notification settings - Fork 1
/
http_binding_openapi.yaml
729 lines (682 loc) · 20.8 KB
/
http_binding_openapi.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
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
openapi: "3.0.0"
info:
description: "IDS spec"
version: "0.8"
title: "IDS http binding"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
tags:
- name: "Catalog"
description: "Catalog endpoints"
- name: "Negotiation"
description: "Negotiation Process - Provider side"
- name: "Negotiation Callbacks"
description: "Negotiation Process Callbacks - Consumer side"
- name: "Transfer"
description: "Transfer Process"
paths:
/catalog/request:
post:
tags:
- "Catalog"
requestBody:
required: True
content:
application/json:
schema:
$ref: "#/components/schemas/CatalogRequestMessage"
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/DcatCatalog"
description: "Result"
/catalog/datasets/{id}:
get:
tags:
- "Catalog"
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"200":
description: "Result"
content:
application/json:
schema:
$ref: "#/components/schemas/DcatDataset"
/negotiations/{id}:
get:
tags:
- "Negotiation"
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"200":
description: "Result"
content:
application/json:
schema:
$ref: "#/components/schemas/ContractNegotiation"
/negotiations/request:
post:
tags:
- "Negotiation"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ContractRequestMessage"
responses:
"201":
description: "The provider connector must return an HTTP 201 (Created) response with the location header set to the location of the contract negotiation and a body containing the ContractNegotiation message"
content:
application/json:
schema:
$ref: "#/components/schemas/ContractNegotiation"
/negotiations/{id}/request:
post:
tags:
- "Negotiation"
description: "The consumer must include the processId. The consumer must include either the offer or offerId property."
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ContractRequestMessage"
responses:
"200":
description: "If the message is successfully processed, the provider connector must return and HTTP 200 (OK) response. The response body is not specified and clients are not required to process it."
/negotiations/{id}/events:
post:
tags:
- "Negotiation"
description: "The consumer must include the processId. The consumer must include either the offer or offerId property."
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ContractNegotiationEventMessage"
responses:
"200":
description: "Result"
/negotiations/{id}/agreement/verification:
post:
tags:
- "Negotiation"
description: "TODO"
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ContractAgreementVerificationMessage"
responses:
"200":
description: "Result"
/negotiations/{id}/termination:
post:
tags:
- "Negotiation"
description: "TODO"
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ContractNegotiationTerminationMessage"
responses:
"200":
description: "Result"
/negotiations/{id}/offer:
post:
tags:
- "Negotiation Callbacks"
description: "Callback on the Consumer side"
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ContractOfferMessage"
responses:
"200":
description: "Result"
/negotiations/{id}/agreement:
post:
tags:
- "Negotiation Callbacks"
description: "Callback on the Consumer side"
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ContractAgreementMessage"
responses:
"200":
description: "Result"
/transfers/request:
post:
tags:
- "Transfer"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/TransferRequestMessage"
responses:
"201":
description: "The provider connector must return an HTTP 201 (Created) response with the location header set to the location of the transfer process and a body containing the TransferProcess message"
content:
application/json:
schema:
$ref: "#/components/schemas/TransferProcess"
components:
schemas:
DspaceFilter:
type: object
CatalogRequestMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "TODO: not finished yet"
properties:
"@type":
type: string
default: "dspace:CatalogRequestMessage"
filter:
$ref: "#/components/schemas/DspaceFilter"
ContractRequestMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "TODO: not finished yet"
properties:
"@type":
type: string
default: "dspace:ContractRequestMessage"
dspace:dataset:
type: string
description: "@id of the dataset"
dspace:dataSet:
type: string
description: "Only there for compatibility reasons. Seems to be a type in the spec"
dspace:processId:
type: string
description: "TODO: Deprecated? To be removed?"
dspace:offer:
$ref: "#/components/schemas/OdrlOffer"
dspace:callbackAddress:
type: string
ContractNegotiationEventMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "TODO: not finished yet"
properties:
"@type":
type: string
default: "dspace:ContractNegotiationEventMessage"
"dspace:processId":
type: string
"dspace:eventType":
type: string
enum:
- "https://w3id.org/dspace/v0.8/FINALIZED"
- "https://w3id.org/dspace/v0.8/ACCEPTED"
- "https://w3id.org/dspace/v0.8/TERMINATED"
ContractAgreementVerificationMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "TODO: not finished yet"
properties:
"@type":
type: string
default: "dspace:ContractAgreementVerificationMessage"
"dspace:processId":
type: string
ContractNegotiationTerminationMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "TODO: not finished yet"
properties:
"@type":
type: string
default: "dspace:ContractNegotiationTerminationMessage"
"dspace:processId":
type: string
"dspace:code":
type: string
description: "TODO: not documented?"
"dspace:reason":
description: "TODO: can be a link / @id too"
type: array
items:
$ref: "#/components/schemas/LanguageValue"
ContractOfferMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "Used for Tranistion Requested -> Offered from Provider -> Consumer Callback endpoint"
properties:
"@type":
type: string
default: "dspace:ContractOfferMessage"
dspace:processId:
type: string
dspace:offer:
$ref: "#/components/schemas/OdrlOffer"
dspace:callbackAddress:
type: string
ContractAgreementMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "Used for Tranistion Requested -> Agreed from Provider -> Consumer Callback endpoint"
properties:
"@type":
type: string
default: "dspace:ContractAgreementMessage"
dspace:processId:
type: string
dspace:agreement:
$ref: "#/components/schemas/OdrlAgreement"
dspace:callbackAddress:
type: string
ContractNegotiation:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
properties:
"@type":
type: string
default: "dspace:ContractNegotiation"
"dspace:processId":
type: string
"dspace:state":
$ref: "#/components/schemas/TransferState"
TransferRequestMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "Used for Transfer Tranistion Start -> Requested from Consumer -> Provider"
properties:
"@type":
type: string
default: "dspace:TransferRequestMessage"
dspace:agreementId:
type: string
description: "The agreementId property refers to an existing contract agreement between the consumer and provider."
dct:format:
type: string
description: "The dct:format property is a format specified by a Distribution for the Asset associated with the agreement. This is generally obtained from the provider Catalog."
dspace:dataAddress:
type: string
description: "The dataAddress property must only be provided if the dct:format requires a push transfer."
dspace:callbackAddress:
type: string
dspace:processId:
type: string
description: "This is an EDC workaround"
TransferStartMessage:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
description: "Used for Transfer Tranistion Requested -> Started from Provider -> Consumer"
properties:
"@type":
type: string
default: "dspace:TransferStartMessage"
dspace:processId:
type: string
dspace:dataAddress:
oneOf:
- type: object
additionalProperties:
type: string
- type: string
TransferProcess:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
properties:
"@type":
type: string
default: "dspace:TransferProcess"
dspace:processId:
type: string
dspace:state:
$ref: "#/components/schemas/TransferState"
NegotiationState:
type: string
enum:
- REQUESTED
- OFFERED
- ACCEPTED
- AGREED
- VERIFIED
- FINALIZED
- TERMINATED
TransferState:
type: string
enum:
- REQUESTED
- STARTED
- TERMINATED
- COMPLETED
- SUSPENDED
LanguageValue:
type: object
properties:
"@value":
type: string
"@language":
type: string
JsonLd:
type: object
properties:
"@context":
type: object
items:
type: string
default: {
"dct": "https://purl.org/dc/terms/",
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
"odrl": "http://www.w3.org/ns/odrl/2/",
"dspace": "https://w3id.org/dspace/v0.8/"
}
"@id":
type: string
DcatDataset:
type: object
properties:
"@id":
type: string
"@type":
type: string
default: "dcat:Dataset"
dct:title:
type: string
dct:description:
type: string
dct:keyword:
type: array
items:
type: string
odrl:hasPolicy:
type: array
items:
$ref: "#/components/schemas/CatalogOffer"
dcat:distribution:
$ref: "#/components/schemas/DcatDistribution"
DcatCatalog:
allOf:
- $ref: "#/components/schemas/JsonLd"
- type: object
properties:
"@type":
type: string
default: "dcat:Catalog"
"dct:title":
type: string
"dct:publisher":
type: string
"dcat:keyword":
type: array
items:
type: string
dcat:service:
$ref: "#/components/schemas/DcatService"
dcat:dataset:
type: array
items:
$ref: "#/components/schemas/DcatDataset"
default: []
DcatDistribution:
type: object
properties:
"@type":
type: string
dct:format:
type: string
dcat:accessService:
type: string
DcatService:
type: object
properties:
"@id":
type: string
"@type":
type: string
dct:terms:
type: string
dct:endpointUrl:
type: string
# rather not used any more. Use strings instead
OdrlOperand:
type: object
properties:
value:
type: string
OdrlOperator:
type: object
properties:
"@id":
type: string
OdrlConstraint:
type: object
properties:
"@type":
type: string
#default: "Constraint"
odrl:leftOperand:
type: string
odrl:operator:
oneOf:
- type: string
- $ref: "#/components/schemas/OdrlOperator"
odrl:rightOperand:
type: string
OdrlLogicalConstraint:
description: "TODO: also add andSequence, or, xone as described here: https://www.w3.org/TR/odrl-vocab/#term-operand"
type: object
properties:
"@id":
type: string
"@type":
type: string
default: "LogicalConstraint"
"odrl:and":
oneOf:
# this is the EDC issue of serializing lists with single item into non-lists
- $ref: "#/components/schemas/OdrlConstraint"
- type: array
items:
$ref: "#/components/schemas/OdrlConstraint"
"odrl:or":
type: array
items:
$ref: "#/components/schemas/OdrlConstraint"
# TODO: https://www.w3.org/TR/odrl-vocab/#term-LogicalConstraint
# andSequence, xone
Action:
type: object
properties:
odrl:type:
type: string
OdrlRule:
description: "The Rule class is the parent of the Permission, Prohibition, and Duty classes. https://www.w3.org/TR/odrl-model/#rule"
type: object
required:
- odrl:action
properties:
odrl:action:
oneOf:
- type: string
- $ref: "#/components/schemas/Action"
# "A Rule MAY have none or one relation sub-property values of type Asset."
# "Explicit sub-properties of the abstract relation, relation and failure
# properties must be used, the choice depending on the subclass of Rule in question."
# -> needs to go into subclasses, e.g. OdrlPermission
odrl:constraint:
oneOf:
# LogicalConstraint
- $ref: "#/components/schemas/OdrlLogicalConstraint"
# to easier parse the object we don't allow the theoretical possible list of LCs
# - type: array
# items:
# $ref: "#/components/schemas/OdrlLogicalConstraint"
# Constraint
- $ref: "#/components/schemas/OdrlConstraint"
- type: array
items:
$ref: "#/components/schemas/OdrlConstraint"
# duty must be defined with their property names in the subclasses, e.g. Permission, Prohibition or Duty
# Since we don't have those yet, all are Rules
#odrl:duty:
# type: array
# items:
# type: string # TODO: what is this exactly?
OdrlPermission:
description: "https://www.w3.org/TR/odrl-model/#permission"
type: object
allOf:
- $ref: "#/components/schemas/OdrlRule"
- type: object
properties:
odrl:target:
type: string
description: "ODRL requires this. DSP did remove it (MUST NOT) and is thinking about to get it back in again. EDC also requires it."
# TODO: may properties: assigner/assignee, duty
OdrlPolicy:
description: "In IDS http binding explicitly does NOT have a target, because this is derived from the enclosing context!"
type: object
properties:
"@id":
type: string
"@type":
type: string
default: "odrl:Policy"
odrl:profile:
type: string
odrl:permission:
oneOf:
- $ref: "#/components/schemas/OdrlPermission"
- type: array
items:
$ref: "#/components/schemas/OdrlPermission"
odrl:prohibition:
oneOf:
- $ref: "#/components/schemas/OdrlRule"
- type: array
items:
$ref: "#/components/schemas/OdrlRule"
odrl:obligation:
oneOf:
- $ref: "#/components/schemas/OdrlRule"
- type: array
items:
$ref: "#/components/schemas/OdrlRule"
CatalogOffer:
description: "In DSP, the Offer in the catalog does explicitly NOT have a target, since it is given from the enclosing context."
allOf:
- $ref: "#/components/schemas/OdrlPolicy"
- type: object
properties:
"@type":
type: string
default: "odrl:Offer"
OdrlOffer:
description: "Only addition compared to the Policy: the target field - which should not be there according to DSP model"
allOf:
- $ref: "#/components/schemas/OdrlPolicy"
- type: object
properties:
"@type":
type: string
default: "odrl:Offer"
odrl:target:
type: string
description: "This is used in EDC, but according to DSP model, this should be removed"
deprecated: true
OdrlAgreement:
description: "Agreement"
allOf:
- $ref: "#/components/schemas/OdrlPolicy"
- type: object
properties:
"@type":
type: string
default: "odrl:Agreement"
odrl:target:
type: string
dspace:timestamp:
oneOf:
- $ref: "#/components/schemas/DspaceTimestamp"
- type: string
dspace:consumerId:
type: string
dspace:providerId:
type: string
DspaceTimestamp:
description: "xsd:dateTime"
properties:
"@type":
type: string
default: "xsd:dateTime"
"@value":
type: string