It seems like if ::my-spec
validates, then (s/and ::my-spec ::my-spec)
should also validate.
This is a simplified version of my actual code, but I'm running into problems validating some data that is spec'd using a combination s/and, s/keys, and s/or. This is the smallest reproduction I could come up with.
(s/def :a/coordinate
(s/or :double double?
:int int?))
(s/valid?
(s/keys)
{:a/coordinate 1.0})
;; true
(s/valid?
(s/and (s/keys))
{:a/coordinate 1.0})
;; true
(s/valid?
(s/and (s/keys)
(s/keys))
{:a/coordinate 1.0})
;; false
(s/explain-str
(s/and (s/keys)
(s/keys))
{:a/coordinate 1.0})
;; "[:double 1.0] - failed: double? in: [:a/coordinate] at: [:a/coordinate :double] spec: :a/coordinate\n[:double 1.0] - failed: int? in: [:a/coordinate] at: [:a/coordinate :int] spec: :a/coordinate\n"