flavor -> source

This commit is contained in:
Michael Jerger 2023-10-17 17:58:12 +02:00
parent 98e1ffe97f
commit 1d402389dd
2 changed files with 5 additions and 6 deletions

View file

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

View file

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