Fork me on GitHub
#ring-swagger
<
2018-09-26
>
mping11:09:29

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

ikitommi11:09:04

@mping those should be removed. PR welcome.

ikitommi11:09:32

it was pre clojure 1.9.0 where the spec was optional. we could require 1.9.0 and it would always be available

mping12:09:22

@ikitommi thanks, I enjoy using compojure-api, I can try a PR

mping12:09:06

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

mping12:09:23

there’s probably a require somewhere thats under my radar or something

ikitommi12:09:24

but, clojure is imperative at the core (multimethods and protocol extensions) and that’s whats happening:

(defmethod cc/named-coercion :schema [_] default-coercion)

ikitommi12:09:00

e.g. you load a namespace, and the schema coercion gets registered. it’s a side-effect.

ikitommi12:09:31

but, no missiles fired here 😉

mping12:09:05

I see, I’ll put up a PR whenever I can

mping12:09:14

thanks for the explanation and plz keep up the good work