Allow sequences in Object/Link properties

This commit is contained in:
bom 2023-07-06 14:15:36 +02:00
parent 95214d3029
commit 2b39da557c

View file

@ -4,20 +4,20 @@
; TODO: We could do these with multispec, but that is too much for a POC
(def objectAndLinkTypes #{; Object Types
"Article"
"Audio"
"Document"
"Event"
"Image"
"Note"
"Page"
"Place"
"Profile"
"Relationship"
"Tombstone"
"Video"
"Article"
"Audio"
"Document"
"Event"
"Image"
"Note"
"Page"
"Place"
"Profile"
"Relationship"
"Tombstone"
"Video"
; Link Types
"Mention"})
"Mention"})
(s/def ::Object (s/or
:uri core/uri-string?
@ -46,20 +46,37 @@
(s/def ::attributedTo (s/or :object ::Object :link ::Link))
(s/def ::actor ::attributedTo)
; TODO: Allow sequences
(s/def ::object (s/or :object ::Object :link ::Link))
(s/def ::object
(s/or :object ::Object
:link ::Link
:objects (s/coll-of ::Object)
:links (s/coll-of ::Link)))
(s/def ::result (s/or :object ::Object :link ::Link))
(s/def ::result
(s/or :object ::Object
:link ::Link
:objects (s/coll-of ::Object)
:links (s/coll-of ::Link)))
(s/def ::target (s/or :object ::Object :link ::Link))
(s/def ::target
(s/or :object ::Object
:link ::Link
:objects (s/coll-of ::Object)
:links (s/coll-of ::Link)))
(s/def ::origin (s/or :object ::Object :link ::Link))
(s/def ::origin
(s/or :object ::Object
:link ::Link
:objects (s/coll-of ::Object)
:links (s/coll-of ::Link)))
(s/def ::instrument (s/or :object ::Object :link ::Link))
(s/def ::instrument
(s/or :object ::Object
:link ::Link
:objects (s/coll-of ::Object)
:links (s/coll-of ::Link)))
(s/def ::verb uri?)
(s/def ::instrument (s/or :object ::Object :link ::Link))
(s/def ::verb core/uri-string?)