Skip to content

Commit d799108

Browse files
authored
feat: change duty from single element to array (#163)
1 parent 5eb77ae commit d799108

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

artifacts/src/main/resources/catalog/example/catalog.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
"rightOperand": "http://example.org/EU"
3131
}
3232
],
33-
"duty": {
34-
"action": "Attribution"
35-
}
33+
"duty": [
34+
{
35+
"action": "Attribution"
36+
}
37+
]
3638
}
3739
]
3840
}

artifacts/src/main/resources/context/odrl.jsonld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"Duty": "odrl:Duty",
5656
"duty": {
5757
"@type": "@id",
58-
"@id": "odrl:duty"
58+
"@id": "odrl:duty",
59+
"@container": "@set"
5960
},
6061
"Constraint": "odrl:Constraint",
6162
"constraint": {

artifacts/src/main/resources/negotiation/contract-schema.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@
191191
}
192192
},
193193
"duty": {
194-
"$ref": "#/definitions/Duty"
194+
"type": "array",
195+
"items": {
196+
"$ref": "#/definitions/Duty"
197+
}
195198
}
196199
},
197200
"required": [

artifacts/src/main/resources/negotiation/example/contract-agreement-message-full.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,18 @@
7171
"rightOperand": "gold"
7272
}
7373
],
74-
"duty": {
75-
"action": "report",
76-
"constraint": [
77-
{
78-
"leftOperand": "event",
79-
"operator": "gt",
80-
"rightOperand": "use"
81-
}
82-
]
83-
}
74+
"duty": [
75+
{
76+
"action": "report",
77+
"constraint": [
78+
{
79+
"leftOperand": "event",
80+
"operator": "gt",
81+
"rightOperand": "use"
82+
}
83+
]
84+
}
85+
]
8486
},
8587
{
8688
"action": "use",

artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/PolicySchemaTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ void setUp() {
5454
"operator": "eq",
5555
"rightOperand": "gold"
5656
}],
57-
"duty": {
57+
"duty": [{
5858
"action": "report"
59-
}
59+
}]
6060
}
6161
]
6262
}""";
@@ -75,9 +75,9 @@ void setUp() {
7575
"operator": "eq",
7676
"rightOperand": "gold"
7777
}],
78-
"duty": {
78+
"duty": [{
7979
"action": "report"
80-
}
80+
}]
8181
}
8282
]
8383
}""";
@@ -96,9 +96,9 @@ void setUp() {
9696
"operator": "eq",
9797
"rightOperand": "gold"
9898
}],
99-
"duty": {
99+
"duty": [{
100100
"action": "report"
101-
}
101+
}]
102102
}
103103
]
104104
}""";
@@ -117,14 +117,14 @@ void setUp() {
117117
"operator": "eq",
118118
"rightOperand": "gold"
119119
}],
120-
"duty": {
120+
"duty": [{
121121
"action": "report",
122122
"constraint": [{
123123
"leftOperand": "event",
124124
"operator": "gt",
125125
"rightOperand": "use"
126126
}]
127-
}
127+
}]
128128
}
129129
]
130130
}""";

0 commit comments

Comments
 (0)