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