This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-18
Channels
- # announcements (22)
- # asami (7)
- # babashka (43)
- # beginners (68)
- # biff (2)
- # calva (10)
- # clj-kondo (7)
- # cljdoc (29)
- # clojure (41)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-europe (25)
- # clojure-gamedev (3)
- # clojure-nl (2)
- # clojure-norway (9)
- # clojure-uk (31)
- # clojurescript (3)
- # community-development (7)
- # cursive (3)
- # data-science (4)
- # datomic (17)
- # emacs (30)
- # honeysql (10)
- # hyperfiddle (39)
- # introduce-yourself (1)
- # jobs-discuss (5)
- # kaocha (1)
- # lsp (11)
- # malli (12)
- # pathom (18)
- # pedestal (3)
- # proletarian (2)
- # quil (11)
- # rdf (46)
- # reitit (8)
- # releases (2)
- # shadow-cljs (34)
- # sql (3)
- # squint (10)
- # tools-deps (24)
- # xtdb (10)
Hi everyone. I'm using reitit.ring
and reitit.coercion.malli
. I have an endpoint that needs to switch the schema bases on the authorization of the user. How can I dynamically switch the schema used for coercion? Would it be better to not use the middleware but run the coercion manually? Thanks
I did not work on that code yet but I imagined doing that in a middleware that runs before coercion. And yeah in the middleware I can also update the schema's of course.
I'd add the authorization type as a field, then write a multi schema that dispatches on it
But I like the idea of being able to construct a schema on the fly based on for example claims in an auth token. There will be many different users, claims map to schemas that need to be combined. The list of possible claims and schemas they map will grow. Lots of dynamic changes going on.