This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-15
Channels
- # aws-lambda (6)
- # beginners (8)
- # cider (12)
- # cljs-dev (12)
- # cljsrn (9)
- # clojars (2)
- # clojure (161)
- # clojure-berlin (9)
- # clojure-italy (10)
- # clojure-russia (18)
- # clojure-spec (20)
- # clojure-uk (18)
- # clojurescript (37)
- # cursive (13)
- # data-science (1)
- # datomic (23)
- # flambo (2)
- # hoplon (22)
- # immutant (11)
- # jobs (1)
- # klipse (11)
- # leiningen (5)
- # liberator (7)
- # luminus (5)
- # lumo (3)
- # off-topic (28)
- # om (8)
- # onyx (15)
- # parinfer (111)
- # pedestal (21)
- # re-frame (6)
- # reagent (38)
- # rum (4)
- # spacemacs (2)
- # specter (34)
- # unrepl (122)
- # untangled (3)
- # vim (1)
- # yada (8)
@ordnungswidrig is this still valid regarding auth in Liberator? https://stackoverflow.com/a/14187220/791795 I would like to use JWT.
Yes, that's still fine. Simply implement authentication and authorization in :authorized
. Have done that with JWT before and it worked. :-)
How can I coerce database UUIDs to strings when a resource is being requested as JSON? (but not otherwise)
I've come up with a very wonky function that check (get-in ctx [:representation :media-type])
and walks the resource data structure, converting UUIDs whenever found. But I wish Clojure JSON libs had support for the #uuid
type 😕
IMO there's a clear >90% case, just like how they deal with keywords: make it a string
You can specify a custom :as-response
function that checks if the media type is JSON and creates a string with whatever JSON lib you want. For all other cases delegate to liberator's stock as-response
implementation. See @pandeiro 's answer on where the media-type is in the context.