Open Wegi opened 3 years ago
When using a set in a spec, the coercion with the json-transformer does not work correctly. Here is a minimal example:
(s/def ::hello #{:one :two :three}) (s/def ::test-set (s/keys :req-un [::hello])) (st/coerce ::test-set (->> {:hello :one} (m/encode "application/json") (m/decode "application/json")) st/json-transformer) ;; => {:hello "one"}
Is it intended to provide the type hint manually as described in the custom coercion section (https://github.com/metosin/spec-tools/blob/master/docs/01_coercion.md)? If so, please close the issue again.
there is no auto-resolution of set types, you need to have (s/and keyword? #{::one :two :three}) for spec-tools to know the type
(s/and keyword? #{::one :two :three})
When using a set in a spec, the coercion with the json-transformer does not work correctly. Here is a minimal example:
Is it intended to provide the type hint manually as described in the custom coercion section (https://github.com/metosin/spec-tools/blob/master/docs/01_coercion.md)? If so, please close the issue again.