flavor -> source

forgefed_star
Michael Jerger 7 months ago
parent 98e1ffe97f
commit 1d402389dd

@ -2,7 +2,6 @@
(:require [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]]
[org.domaindrivenarchitecture.fed-poc.spec-helper :as sh]
[org.domaindrivenarchitecture.fed-poc.owl :as owl]
[org.domaindrivenarchitecture.fed-poc.activitystreams2 :as as]
[org.domaindrivenarchitecture.fed-poc.xsd :as xsd]
[org.domaindrivenarchitecture.fed-poc.activitystreams2 :as as]))
@ -18,13 +17,13 @@
(s/def ::Star
(s/merge
::as/Activity
(sh/map-spec (s/keys :opt [::flavor]))))
(sh/map-spec (s/keys :opt [::source]))))
;https://forgefed.org/ns#Unstar
(s/def ::Unstar
(s/merge
::as/Activity
(sh/map-spec (s/keys :opt [::flavor]))))
(sh/map-spec (s/keys :opt [::source]))))
(s/def ::flavor
(s/def ::source
(sh/seq-spec ::xsd/anyURI))

@ -26,7 +26,7 @@
(is (s/valid? ::sut/Star
{::as/id "https://repo.prod.meissa.de/api/activitypub/user-id/1/outbox/12345",
::as/type "Star",
::sut/flavor "forgejo",
::sut/source "forgejo",
::as/actor "https://repo.prod.meissa.de/api/activitypub/user-id/1",
::as/object "https://codeberg.org/api/repos/forgejo/forgejo"})))))
@ -36,6 +36,6 @@
(is (s/valid? ::sut/Unstar
{::as/id "https://repo.prod.meissa.de/api/activitypub/user-id/1/outbox/12345",
::as/type "Unstar",
::sut/flavor "forgejo",
::sut/source "forgejo",
::as/actor "https://repo.prod.meissa.de/api/activitypub/user-id/1",
::as/object "https://codeberg.org/api/repos/forgejo/forgejo"})))))
Loading…
Cancel
Save