plumatic / schema

Clojure(Script) library for declarative data description and validation
Other
2.41k stars 257 forks source link

Clarify behavior of primitive type hints in s/defn (fixes #264, closes #270) #285

Closed w01fe closed 9 years ago

w01fe commented 9 years ago

As discussed in the linked tickets, all primitives are potentially valid type hints in Clojure.

Since in principle schemas aren't limited just to function arguments, it doesn't seem correct to limit the handling of primitives to just where they are allowed in function arguments. Instead, I think it's better to just make the user aware that they should only use the primitive schemas where they would normally be appropriate in Clojure, and otherwise used boxed versions (the same way you would with, e.g. type hints on an ordinary defn.) This PR updates the docs accordingly.

loganlinn commented 9 years ago

sgtm!