-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
:key-fn
for encoding keys with babashka.json/write-str
#10
Comments
Right now I'm using This works: (json/read-str s {:key-fn inflections/hyphenate}) But not this: (json/write-str x {:key-fn inflections/underscore}) |
I guess so, if the underlying libraries support it too? |
I can check if any of the libraries don't support this and get back to you. |
@borkdude: I wrote a test to show how this is done for each lib (see README to run it yourself): https://github.com/rads/json-key-fns/blob/main/src/rads/json_key_fns.clj The only one that doesn't support it easily is
If we want to move forward with this, I can follow up with PRs and reach out to @cnuernber if needed. If it's not worth the effort, I'll go ahead and close this issue. |
Added another option to the list above to throw an exception if using |
And one more option for coercing the keys before calling |
Talking to the charred author seems like a reasonable next step?
…On Sat, Nov 9, 2024 at 12:02 AM Radford Smith ***@***.***> wrote:
And one more option for coercing the keys before calling charred. 😄
—
Reply to this email directly, view it on GitHub
<#10 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACFSBUVBOV4FLM2VP45NQTZ7U7HPAVCNFSM6AAAAABROLOI6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRVHA3TOMZVGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sounds good, I'll get back to you when I have some more info. |
Would it make sense to add
:key-fn
forbabashka.json/write-str
for encoding keys since this is already supported for decoding keys withread-str
?The text was updated successfully, but these errors were encountered: