This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-26
Channels
- # 100-days-of-code (3)
- # announcements (2)
- # beginners (237)
- # bitcoin (2)
- # boot (5)
- # cider (15)
- # cljs-dev (9)
- # cljsrn (6)
- # clojure (75)
- # clojure-estonia (1)
- # clojure-italy (8)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-spec (68)
- # clojure-uk (80)
- # clojurescript (89)
- # cursive (31)
- # datomic (22)
- # emacs (2)
- # events (3)
- # figwheel-main (184)
- # fulcro (28)
- # graphql (1)
- # hyperfiddle (2)
- # jobs (1)
- # jobs-discuss (64)
- # luminus (5)
- # off-topic (16)
- # om (2)
- # onyx (1)
- # pedestal (12)
- # portkey (1)
- # re-frame (13)
- # reagent (56)
- # reitit (13)
- # ring-swagger (13)
- # shadow-cljs (145)
- # slack-help (2)
- # specter (6)
Hi, is there a way to fine tune compojure-api coercion? Whenever I run a main class, I get a bunch of compojure.api.coercion.schema - :schema coercion enabled in compojure.api
hinting that some how I’m starting compojure-api
it was pre clojure 1.9.0 where the spec was optional. we could require 1.9.0 and it would always be available
but what really bothers me is that it seems that somehow I’m running some compojure-api code even though I’m just doing lein run -m some.main.class
it’s happening when a require is followed and a namespace is loaded. just an extra log-line: https://github.com/metosin/compojure-api/blob/85738b802c7f150f4f550ffca91a4782c75f8091/src/compojure/api/coercion/schema.clj#L93
but, clojure is imperative at the core (multimethods and protocol extensions) and that’s whats happening:
(defmethod cc/named-coercion :schema [_] default-coercion)
e.g. you load a namespace, and the schema coercion gets registered. it’s a side-effect.