Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion artifacts/buildSrc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For example:
<td></td>
</tr>
<tr>
<td class="code">permission</td>
<td class="code">rule</td>
<td>array</td>
<td></td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ public interface TestSchema {
"permission": {
"type": "array",
"items": {
"$ref": "#/definitions/Permission"
"$ref": "#/definitions/Rule"
},
"minItems": 1
},
"prohibition": {
"type": "array",
"items": {
"$ref": "#/definitions/Rule"
},
"minItems": 1
},
Expand Down Expand Up @@ -177,7 +184,7 @@ public interface TestSchema {
"assigner"
]
},
"Permission": {
"Rule": {
"type": "object",
"properties": {
"action": {
Expand Down
11 changes: 9 additions & 2 deletions artifacts/src/main/resources/negotiation/contract-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@
"permission": {
"type": "array",
"items": {
"$ref": "#/definitions/Permission"
"$ref": "#/definitions/Rule"
},
"minItems": 1
},
"prohibition": {
"type": "array",
"items": {
"$ref": "#/definitions/Rule"
},
"minItems": 1
},
Expand Down Expand Up @@ -178,7 +185,7 @@
"assigner"
]
},
"Permission": {
"Rule": {
"type": "object",
"properties": {
"action": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void verifySchema() {
assertThat(schema.validate(POLICY_STRING_PROFILE, JSON)).isEmpty();
assertThat(schema.validate(POLICY_ARRAY_PROFILE, JSON)).isEmpty();
assertThat(schema.validate(POLICY_PERMISSION_DUTY, JSON)).isEmpty();
assertThat(schema.validate(POLICY_PROHIBITION_DUTY, JSON)).isEmpty();
assertThat(schema.validate(POLICY_OR_CONSTRAINT, JSON)).isEmpty();
assertThat(schema.validate(POLICY_AND_CONSTRAINT, JSON)).isEmpty();
assertThat(schema.validate(POLICY_AND_SEQUENCE_CONSTRAINT, JSON)).isEmpty();
Expand Down Expand Up @@ -129,6 +130,32 @@ void setUp() {
]
}""";

private static final String POLICY_PROHIBITION_DUTY = """
{
"@id": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
"@type": "Offer",
"target": "asset:1",
"profile": ["https://test.com/profile"],
"prohibition": [
{
"action": "use",
"constraint": [{
"leftOperand": "partner",
"operator": "eq",
"rightOperand": "gold"
}],
"duty": [{
"action": "report",
"constraint": [{
"leftOperand": "event",
"operator": "gt",
"rightOperand": "use"
}]
}]
}
]
}""";


private static final String POLICY_OR_CONSTRAINT = """
{
Expand Down
2 changes: 1 addition & 1 deletion specifications/common/type.definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<p data-include="message/table/offer.html" data-include-format="html">
</p>

<p data-include="message/table/permission.html" data-include-format="html">
<p data-include="message/table/rule.html" data-include-format="html">
</p>

<p data-include="message/table/versionresponse.html" data-include-format="html">
Expand Down
Loading