Fork me on GitHub
#reitit
<
2021-11-09
>
Yehonathan Sharvit14:11:12

A question related to muuntaja: Do you guys think it's a good idea that by default keys in a JSON string are coerced to keywords?

1
lsenjov02:11:41

This is a big case of "it depends". The differentiator for me is whether it's actually mean to be used as a keyword, or it's actually a string in they key position

lsenjov02:11:33

I'm still dealing with tech debt from all keys as keywords by default, because of the weirdness you get with things like uuid ids getting converted to keywords, suddenly all the logic gets really weird

practicalli-johnny08:11:33

Yes. So long as the coercion can be switched off, default coercion to keywords fits my default approach

Yehonathan Sharvit14:11:40

I tend to think that it's a misused of Clojure keywords, as a the keys could be anything, including weird characters (e.g. whitespace) I know that Clojure keywords support whitespace but it's not advised to have werid characters in a keyword. As far as I understand it, Clojure keywords are meant to be used when the set of possible keys is well known in advance.

Yehonathan Sharvit14:11:27

It seems that the fact that keywords behave as functions in Clojure cause an overuse of keywords

ns15:11:36

Beginner question about Reitit on frontend: Can Reitit parse url query params, for example /widgets?color=blue&sort=newest ?

Apple00:11:08

Most likely the answer is yes