Fork me on GitHub
#ring-swagger
<
2018-03-26
>
slipset21:03:19

This kind'a trips me up a bit:

slipset21:03:23

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

slipset21:03:48

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.

slipset21:03:27

so, I'm actually doing this:

slipset21:03:52

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

slipset21:03:36

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