Skip to content
This repository has been archived by the owner on Jan 30, 2019. It is now read-only.

Specifying keyword and string keys in query params map causes error #19

Open
no-man-is-an-island opened this issue Jan 7, 2016 · 0 comments

Comments

@no-man-is-an-island
Copy link

If a map like this:

{:a 1 "b" 2}

Is passed to map->query (or to url as the :query map), the function throws an error:

java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.String
    at java.lang.String.compareTo(String.java:111)
    at clojure.lang.Util.compare(Util.java:153)
    at clojure.lang.APersistentVector.compareTo(APersistentVector.java:424)
    at clojure.lang.Util.compare(Util.java:153)
    at clojure.core$compare.invoke(core.clj:805)
    at clojure.lang.AFunction.compare(AFunction.java:47)
    at java.util.TimSort.countRunAndMakeAscending(TimSort.java:351)
    at java.util.TimSort.sort(TimSort.java:216)

This is caused by sort trying to compare string and keyword keys.

I can try to submit a pull request for this - just need to call name on the keys before sorting I think.

no-man-is-an-island added a commit to no-man-is-an-island/url that referenced this issue Jan 7, 2016
…tring and keyword keys are used. Add test case.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant