Fork me on GitHub
#ring-swagger
<
2019-02-08
>
Empperi08:02:29

@ikitommi quick question, shouldn't this coerce to keyword? (it doesn't)

(st/coerce 
  (st/spec
    {:spec #{:foo/bar}
     :decode/string keyword})
  "foo/bar"
  st/json-transformer)
=> "foo/bar"

Empperi08:02:56

If I change the spec to keyword? then it works fine. But when I want to limit the possible keywords that's not an acceptable solution

Empperi08:02:50

This is an annoying problem 😕

Empperi08:02:38

OK. Found a way to fix it

Empperi08:02:56

(s/and keyword? #{:foo/bar})

Empperi08:02:23

Now coercion works

👍 5