File tree Expand file tree Collapse file tree 2 files changed +39
-11
lines changed
main/resources/negotiation
test/java/org/eclipse/dsp/schema/negotiation Expand file tree Collapse file tree 2 files changed +39
-11
lines changed Original file line number Diff line number Diff line change 213
213
"properties" : {
214
214
"and" : {
215
215
"type" : " array" ,
216
- "items" : " object"
216
+ "items" : {
217
+ "$ref" : " #/definitions/Constraint"
218
+ }
217
219
},
218
220
"andSequence" : {
219
221
"type" : " array" ,
220
- "items" : " object"
222
+ "items" : {
223
+ "$ref" : " #/definitions/Constraint"
224
+ }
221
225
},
222
226
"or" : {
223
227
"type" : " array" ,
224
228
"items" : {
225
- "oneOf" : [
226
- {
227
- "$ref" : " #/definitions/LogicalConstraint"
228
- },
229
- {
230
- "$ref" : " #/definitions/AtomicConstraint"
231
- }
232
- ]
229
+ "$ref" : " #/definitions/Constraint"
233
230
}
234
231
},
235
232
"xone" : {
236
233
"type" : " array" ,
237
- "items" : " object"
234
+ "items" : {
235
+ "$ref" : " #/definitions/Constraint"
236
+ }
238
237
}
239
238
},
240
239
"oneOf" : [
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ void verifyInvalidCases() {
32
32
assertThat (schema .validate (INVALID_NO_OPERATOR , JSON ).iterator ().next ().getType ()).isEqualTo (ONE_OF );
33
33
assertThat (schema .validate (INVALID_NO_RIGHT_OPERAND , JSON ).iterator ().next ().getType ()).isEqualTo (ONE_OF );
34
34
assertThat (schema .validate (INVALID_MULTIPLICITY_CONSTRAINT , JSON ).iterator ().next ().getType ()).isEqualTo (ONE_OF );
35
+ assertThat (schema .validate (INVALID_LOGICAL_CONTENT_NESTING , JSON ).iterator ().next ().getType ()).isEqualTo (ONE_OF );
35
36
}
36
37
37
38
@ BeforeEach
@@ -161,4 +162,32 @@ void setUp() {
161
162
]
162
163
}
163
164
""" ;
165
+
166
+ private static final String INVALID_LOGICAL_CONTENT_NESTING = """
167
+ {
168
+ "@id": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
169
+ "@type": "Offer",
170
+ "target": "asset:1",
171
+ "permission": [
172
+ {
173
+ "action": "use",
174
+ "constraint": {
175
+ "and": [
176
+ {
177
+ "leftOperand": "partner",
178
+ "operator": "eq",
179
+ "rightOperand": "gold"
180
+ },
181
+ {
182
+ "something": "that",
183
+ "is": "definitely",
184
+ "not": "a",
185
+ "valid": "constraint"
186
+ }
187
+ ]
188
+ }
189
+ }
190
+ ]
191
+ }
192
+ """ ;
164
193
}
You can’t perform that action at this time.
0 commit comments