-
Notifications
You must be signed in to change notification settings - Fork 149
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
(s/and …) seems to trip up query checking #336
Comments
@eneroth I think I had a similar error one time. Are you by any change using In my case I was using conformers in the validate functions and since spec-tools still dont support them then I was getting those very cryptic errors. |
Sorry for the lag, we have been super busy with everything. Will try to resolve this next week. |
The root cause was in spec-tools: if you update to latest spec-tools, this should have gone away. And there is a regression test on compojure-api side too.
|
and here's the new versions for (defmethod extract-from-form 'clojure.spec.alpha/and [_ form]
(extract (second form))) and (defmethod extract-from-form 'clojure.spec.alpha/keys [_ form]
(let [{:keys [req opt req-un opt-un]} (some->> form (rest) (apply hash-map))]
{:type :map
:keys (set
(flatten
(concat
(map impl/polish (concat req opt))
(map impl/polish-un (concat req-un opt-un)))))})) |
Here's the spec for the query parameters:
Here's the API definition:
The above works fine. Now I want to do some more rigorous checking of the query parameters, so I change the query spec to this:
This makes spec complain that something is invalid, but it's curiously unspecific as to what. I thought maybe one of my predicates was throwing it off, so I tried this:
It still throws the same error. Here's the error, in JSON:
If I check it manually with the same values, no error is thrown:
The text was updated successfully, but these errors were encountered: