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

Class cast exception when attempting to coerce spec #79

Closed
mgrbyte opened this issue Oct 6, 2017 · 3 comments · Fixed by #80
Closed

Class cast exception when attempting to coerce spec #79

mgrbyte opened this issue Oct 6, 2017 · 3 comments · Fixed by #80

Comments

@mgrbyte
Copy link

mgrbyte commented Oct 6, 2017

I have a spec which is giving the error:
java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Named
when attempting to load the swagger UI for a compojure-api app.
The failing spec appears to be one that uses conditional keys in a :req parameter of a clojure.spec/keys declaration.

Environment:

  • [org.clojure/clojure "1.9.0-alpha17"]
  • [metosin//compojure-api "2.0.0-alpha7"]
  • [metosin/spec-tools "0.4.0-SNAPSHOT"]
@mgrbyte
Copy link
Author

mgrbyte commented Oct 6, 2017

A full copy of the traceback:
spec-class-cast-tb.txt

@ikitommi
Copy link
Member

ikitommi commented Oct 7, 2017

Problem was that the or and and were not parsed correctly under s/keys required keys. Should be fixed now, could you verify with [metosin/spec-tools "spec-tools-0.4.0-20171007.191128-3"].

@mgrbyte
Copy link
Author

mgrbyte commented Oct 9, 2017

@ikitommi I can verify that 0.4.0-20171007.191128-3 fixes the issue. Thanks for looking into it so quickly! 👍 💯

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

Successfully merging a pull request may close this issue.

2 participants