ring-swagger

ring-swagger & compojure-api
slipset 2018-03-26T21:23:19.000360Z

This kind'a trips me up a bit:

slipset 2018-03-26T21:23:23.000097Z

(spec-tools.core/conform (spec/or :string string?) "foo")
;; => [:string "foo"]

slipset 2018-03-26T21:24:48.000414Z

I really don't care about the type here, so I was expecting it to only return "foo". I see that spec does this, but I'm using this in a coercing context, and my app is expecting "foo", not information about the type.

slipset 2018-03-26T21:27:27.000471Z

so, I'm actually doing this:

slipset 2018-03-26T21:27:52.000252Z

(spec-tools.core/conform (spec/or :string string? :number number?) "foo" spec-tools.core/json-conforming)

slipset 2018-03-26T21:29:36.000616Z

maybe a spec-tools.core/coerce would be nice? which does the coercion?