Fork me on GitHub
#clojure-dev
<
2022-01-06
>
mpenet16:01:12

(s/explain-data (s/map-of keyword? string?) {:foo :bar}) -> #:clojure.spec.alpha{:problems ({:path [1] :in [:foo 1] ...})}

mpenet16:01:41

the :path and :in are quite odd, shouldn't :in be just [:foo] ?

mpenet16:01:55

(that's spec1)

mpenet16:01:51

or maybe it means index 1 in the map-entry

mpenet16:01:00

but that's a bit odd

mpenet16:01:20

seems like it could be because map-of is implemented with every

mpenet16:01:03

so you get "collection" explain output

Alex Miller (Clojure team)16:01:57

it is 1 because of the map entry - :in are always indexable things so that's really the only choice I think

mpenet16:01:27

but I don't think you get the same output for a s/keys

mpenet16:01:35

I didn't try, but i'd be surprised

Alex Miller (Clojure team)16:01:41

we may have a ticket for this, don't remember

mpenet16:01:34

yeah, s/keys returns [:foo] for both :path and :in

mpenet16:01:34

I'd classify that as a bug. I ll check jira

mpenet16:01:29

I find no jira about this, do you want me to create one?