Skip to content

Commit dc64ea9

Browse files
committed
LRS-30 naive addition of context agents, groups
1 parent 2427b02 commit dc64ea9

1 file changed

Lines changed: 51 additions & 2 deletions

File tree

src/xapi_schema/spec.cljc

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,51 @@
949949
(s/def :context/extensions
950950
::extensions)
951951

952+
;; 2.0.x compat
953+
954+
;; contextAgents
955+
(s/def :contextAgent/objectType #{"contextAgent"})
956+
(s/def :contextAgent/agent ::agent)
957+
(s/def :contextAgent/relevantTypes
958+
(s/every ::iri
959+
:into []
960+
:min-count 1))
961+
962+
(s/def ::context-agent
963+
(conform-ns "contextAgent"
964+
(s/and
965+
(s/keys :req [:contextAgent/objectType
966+
:contextAgent/agent]
967+
:opt [:contextAgent/relevantTypes])
968+
(restrict-keys :contextAgent/objectType
969+
:contextAgent/agent
970+
:contextAgent/relevantTypes))))
971+
(s/def :context/contextAgents
972+
(s/every ::context-agent
973+
:into []))
974+
975+
;; contextGroups
976+
977+
(s/def :contextGroup/objectType #{"contextGroup"})
978+
(s/def :contextGroup/group ::group)
979+
(s/def :contextGroup/relevantTypes
980+
(s/every ::iri
981+
:into []
982+
:min-count 1))
983+
984+
(s/def ::context-group
985+
(conform-ns "contextGroup"
986+
(s/and
987+
(s/keys :req [:contextGroup/objectType
988+
:contextGroup/group]
989+
:opt [:contextGroup/relevantTypes])
990+
(restrict-keys :contextGroup/objectType
991+
:contextGroup/group
992+
:contextGroup/relevantTypes))))
993+
(s/def :context/contextGroups
994+
(s/every ::context-group
995+
:into []))
996+
952997
(s/def ::context
953998
(conform-ns "context"
954999
(s/and
@@ -960,7 +1005,9 @@
9601005
:context/platform
9611006
:context/language
9621007
:context/statement
963-
:context/extensions])
1008+
:context/extensions
1009+
:context/contextAgents
1010+
:context/contextGroups])
9641011
(restrict-keys :context/registration
9651012
:context/instructor
9661013
:context/team
@@ -969,7 +1016,9 @@
9691016
:context/platform
9701017
:context/language
9711018
:context/statement
972-
:context/extensions))))
1019+
:context/extensions
1020+
:context/contextAgents
1021+
:context/contextGroups))))
9731022

9741023
;; Attachments
9751024

0 commit comments

Comments
 (0)