diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj index 01a4b23..4a4c43c 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj @@ -5,6 +5,7 @@ [org.domaindrivenarchitecture.activity-pub-poc.common :as cm] [clojure.spec.alpha :as s] [orchestra.core :refer [defn-spec]] + [clojure.data.json :as json] [clojure.inspector :as ins] [hato.client :as hato] [clojure.string :as st] @@ -49,6 +50,7 @@ (s/def to-uri uri-vector?) (s/def actor uri-string?) (s/def object uri-string?) + (s/def ::to uri-string?) (s/def ::target string?) (s/def ::from uri-string?) @@ -82,6 +84,13 @@ "actor" (:from input-map) "object" (:target input-map))) +(defn-spec write-json-ld string? + [input map? + filename string?] + (-> + input + (json/write-str) + (#(spit filename %))))