ring-swagger

ring-swagger & compojure-api
Empperi 2019-02-08T08:01:29.087100Z

@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"

Empperi 2019-02-08T08:02:56.087800Z

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

Empperi 2019-02-08T08:34:50.088100Z

This is an annoying problem 😕

Empperi 2019-02-08T08:49:38.088600Z

OK. Found a way to fix it

Empperi 2019-02-08T08:49:56.089Z

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

Empperi 2019-02-08T08:50:23.089200Z

Now coercion works

1👍