This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-18
Channels
- # announcements (6)
- # aws (1)
- # babashka (47)
- # beginners (50)
- # calva (65)
- # cider (4)
- # clj-commons (1)
- # clj-kondo (44)
- # clojure (150)
- # clojure-europe (41)
- # clojure-nl (4)
- # clojure-spec (1)
- # clojure-sweden (4)
- # clojure-uk (6)
- # clojurescript (15)
- # clr (1)
- # conjure (1)
- # core-async (7)
- # cursive (5)
- # datomic (12)
- # events (2)
- # fulcro (17)
- # graphql (12)
- # introduce-yourself (1)
- # jackdaw (5)
- # jobs (2)
- # lsp (52)
- # malli (5)
- # meander (3)
- # minecraft (2)
- # missionary (2)
- # off-topic (10)
- # other-languages (9)
- # reitit (9)
- # remote-jobs (1)
- # ring (8)
- # rum (7)
- # shadow-cljs (9)
- # sql (2)
- # tools-deps (20)
- # xtdb (12)
thanks @U11EL3P9U no luck there.. I think its as @U49RJG1L0 said it’s because i’m not using coll-of
but I cant’ find any sample on the metosin site or the github repos for this project that show that use case - they’re all extremely simple samples that don’t show the use of things like rendering out collections in your response. (map of list of maps)
my goal for the response is to have it look like { "users": [{"id": 1… }, {"id": 2}]}
(map with a list of maps) but I can’t even figure out how to just render a list yet.
You can define a spec for it elsewhere and the use the spec for example:
(s/def ::user :your-user-definition)
(s/def ::users (s/coll-of ::user))
(s/def ::response (s/keys :req-un [::users]))
You can then use ::response
in your route spec definitionUgh, I'm getting a java.lang.ClassCastException if reitit.ring.middleware.muuntaja/format-request-middleware is on, but there's no trace in the exception
Hm, if I enable coercion, I'm getting a malli error with no path in :errors 😕 I wonder if that's related