We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5559ea commit 184fbf3Copy full SHA for 184fbf3
1 file changed
src/xapi_schema/spec.cljc
@@ -1372,8 +1372,16 @@
1372
(some-> s :statement/object :statement-ref/objectType)
1373
true)))))
1374
1375
+(defn unique-statement-ids?
1376
+ "Spec predicate to ensure that the IDs of a list of statements are unique."
1377
+ [statements]
1378
+ (or (distinct? (map #(get % "id") statements))
1379
+ ::s/invalid))
1380
+
1381
(s/def ::statements
- (s/coll-of ::statement :into []))
1382
+ (s/and
1383
+ (s/coll-of ::statement :into [])
1384
+ unique-statement-ids?))
1385
1386
(s/def ::lrs-statements
1387
(s/coll-of ::lrs-statement :into []))
0 commit comments