muuntaja
muuntaja copied to clipboard
Add charred json formatter module
This PR adds charred as a JSON encode/decoder module for muuntaja, like cheshire.
The code comes from a private project that uses muuntaja + reitit.
Open to suggestions for how to test and build it locally in the context of this repo, as well as any change requests.
Hi! This looks very good, but it'd need some tests. Would you be able to add those? You can see how the Cheshire integration is tested here https://github.com/metosin/muuntaja/blob/master/test/muuntaja/core_test.clj For Charred, it'd be essentially the same tests needed.
Thanks! Do you have any advice for how to run the project locally, i.e. dev setup? This is where I struggled to figure out how to add and run tests.
You can try lein with-profile default,dev repl
, which should get you an nREPL server with the dev
profile loaded.
Thanks, that helped me get started. Changes in last commit:
- Added charred tests
- Updated encoding handler for charred (default to encode-unicode false now, see opts in https://github.com/cnuernber/charred/blob/master/src/charred/api.clj#L708)
- Updated Contributing docs
- Add charred module to the scripts file
- Fix charred dep not loading properly
Let me know if anything else seems off!
This is so great! I considered doing this (around the same time that you were actually just doing it, apparently).
With this I think we can perhaps remove cheshire + jsonista and other conflict ridden deps from some of our infrastructure pathways and for that I am grateful. Thanks all! :bow: