Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st/fail-on-extra-keys-transformer does not work? #151

Closed
miikka opened this issue Nov 26, 2018 · 1 comment
Closed

st/fail-on-extra-keys-transformer does not work? #151

miikka opened this issue Nov 26, 2018 · 1 comment

Comments

@miikka
Copy link
Contributor

miikka commented Nov 26, 2018

I'd expect st/explain to reply Success!, but it fails instead:

(require '[clojure.spec.alpha :as s] '[spec-tools.core :as st] '[spec-tools.data-spec :as ds])
(s/def ::bar (ds/spec {:name ::bar, :spec {:foo int?}}))
(st/explain ::bar {:foo 123} st/fail-on-extra-keys-transformer)
;; => {:foo 123} - failed: (keys :req-un [:user$bar/foo]) spec: :user/bar

It fails with non-data specs as well:

(s/def ::quux (st/spec (s/keys :req-un [::foo])))
(st/explain ::quux {:foo 123} st/fail-on-extra-keys-transformer)
;; => {:foo 123} - failed: (keys :req-un [:user/foo]) spec: :user/quux
miikka added a commit to miikka/spec-tools that referenced this issue Nov 26, 2018
@miikka
Copy link
Contributor Author

miikka commented Nov 26, 2018

Probably broken since 0.8.0 where :keys was renamed to ::parse/keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant