From 2b39da557cd7c1b63dadc3031f4fc7f8a11bdb34 Mon Sep 17 00:00:00 2001 From: bom Date: Thu, 6 Jul 2023 14:15:36 +0200 Subject: [PATCH] Allow sequences in Object/Link properties --- .../activity_pub_poc/activitystreams2.clj | 61 ++++++++++++------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj index b410ecc..f792e64 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj @@ -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?)