Skip to content
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

Output JSON properties that are not ALLCAPS. #68

Open
dbarros opened this issue Aug 13, 2021 · 2 comments
Open

Output JSON properties that are not ALLCAPS. #68

dbarros opened this issue Aug 13, 2021 · 2 comments

Comments

@dbarros
Copy link

dbarros commented Aug 13, 2021

Is it possible to configure jonathan so that it can output, and parse, JSON that has properties that are not in ALLCAPS?

For example, the JSON may use all lowercase for property name, or camelCase, or snake_case. e.g.:

{ "first_name": "Charlie"; }

or

{ "firstName": "Charlie"; }

@dbarros dbarros changed the title Deal with JSON properties that are not ALLCAPS. Output JSON properties that are not ALLCAPS. Aug 13, 2021
@jg20019
Copy link

jg20019 commented Jan 9, 2022

Yes. One way you can do it is to when you output json, you use write-key-value and with-object directly. There is an example on this page: http://rudolph-miller.github.io/jonathan/. You can find it in the example, where you define a method to-json to output a user class as json

@jg20019
Copy link

jg20019 commented Aug 18, 2022

I found a better way:

(jonathan:to-json '(("first_name" . "charlie")) :from :alist)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants