This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-10
Channels
- # aws (3)
- # beginners (186)
- # boot (25)
- # cider (2)
- # cljsrn (57)
- # clojure (161)
- # clojure-boston (1)
- # clojure-dusseldorf (11)
- # clojure-italy (5)
- # clojure-russia (20)
- # clojure-serbia (1)
- # clojure-spec (10)
- # clojure-uk (16)
- # clojurescript (207)
- # community-development (86)
- # core-async (2)
- # cursive (40)
- # datascript (1)
- # datomic (2)
- # editors (5)
- # emacs (8)
- # funcool (1)
- # gsoc (2)
- # hoplon (2)
- # jobs (5)
- # leiningen (3)
- # liberator (18)
- # luminus (18)
- # off-topic (106)
- # om (2)
- # onyx (5)
- # pedestal (7)
- # powderkeg (7)
- # re-frame (7)
- # remote-jobs (1)
- # ring-swagger (4)
- # rum (5)
- # slack-help (1)
- # untangled (11)
- # yada (48)
I'm trying to extend liberator:
(extend-protocol Representation
clojure.lang.PersistentHashSet
(as-response [this context]
{:body "asdf"}))
but I'm still seeing: No implementation of method: :as-response of protocol: #'liberator.representation/Representation found for class: clojure.lang.PersistentHashSet
That’s weird. Try to call as-response
on an instance of HashSet directly. Does that work?
#error {
:cause "No implementation of method: :as-response of protocol: #'liberator.representation/Representation found for class: clojure.lang.PersistentHashSet"
I will try to reproduce. Independent of the actual protocol that should work.
hmm this does appear to be [liberator "0.12.0"]
not sure if this would've been fixed between versions
Don't quite understand. Is it broken in 0.12 for you but ok in a different revision?
hmm, it's fine with wrapping the set in a map: (as-response {:x #{:a 1}} {:representation {:media-type "application/json"}})
That is a map which is supported by liberator out of the box. I suspect that somehow the extend-protocol
is not executed.
@owen there’s something wrong with your protocol extension. Make sure the namespace where the extension is called is required and loaded. It works for me as expected:
This is on latest master but I don’t think it would make a difference on 0.12.0
Tested in 0.12.0 an works locally. I’m pretty sure your call to extend-protocol
is not executed.