hato icon indicating copy to clipboard operation
hato copied to clipboard

Using clojure.data.json instead of cheshire

Open rome-user opened this issue 3 years ago • 2 comments

Hi.

I typically use clojure.data.json for JSON parsing, since cheshire is quite heavy and its transitive dependencies often get CVEs. Would you be interested in a patch that allows users to supply data.json as a JSON parsing library instead? As far as I can tell, this library does not use functionality specific to cheshire.

rome-user avatar Jan 16 '23 06:01 rome-user

https://github.com/gnarroway/hato/blob/master/src/hato/middleware.clj#L69

json-encode and decode are dynamic so I guess you can override them in your own code. Still it would be nice to also have built-in support for data.json

fversnel avatar Jan 16 '23 09:01 fversnel

I'll write a patch soon. I have nothing against Cheshire, but I like being able to use data.json

rome-user avatar Jan 16 '23 11:01 rome-user