Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by

As noted in this thread (https://groups.google.com/forum/#!topic/clojure/i8Rz-AnCoa8),
`s/keys`
does not validate that the specs mentioned within it are valid specs.

A suggested workaround is to separately write code that could inspect the registry and warn about specs that are not declared. A sketch of this code was provided at https://gist.github.com/stuarthalloway/f4c4297d344651c99827769e1c3d34e9

While the general approach is a good one, I believe it won't work for multi-specs that contain "keys" specs.
`s/form`
on a multi-spec will only return that the spec is a multi-spec (which makes sense), but there is no way for a client to get access to code that picks the approach spec given data.

A further workaround is provided in the comments to that gist, but since it relies on
`resolve`
, it will not work on Clojurescript.

I think
`s/form`
is behaving correctly in this case, but it would be useful to have an additional function that, given a multi-spec, could return a function or data that could be used to explore the current implementations.

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2294 (reported by bbrinck)
...