Skip to content

s/explain-data throws exception for s/map-of spec with a s/or key #262

@rfhayashi

Description

@rfhayashi
(s/explain-data
 (st/spec
  (s/map-of (s/or :keyword keyword? :string string?) any?))
 {:a 1})

throws a nth not supported on this type: Keyword exception.

This is due to a known issue of clojure spec (https://clojure.atlassian.net/browse/CLJ-2199).

Although we could wait for that fix, I think the call to s/unform here seems unnecessary since at that point we still have the original value. Doing this did solve the problem for me.

Is my understanding correct? Wanted to confirm before opening a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions