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

Create additional JSONTextMode #39

Open
hybridherbst opened this issue Nov 7, 2020 · 2 comments
Open

Create additional JSONTextMode #39

hybridherbst opened this issue Nov 7, 2020 · 2 comments

Comments

@hybridherbst
Copy link

hybridherbst commented Nov 7, 2020

Currently, the default serialization produces
"key" : "value" (note: two spaces)
and the compact one produces
"key":"value" (note: no space)

I'd like to see a third option here that produces another commonly seen format (the most common one I'm seeing at least):
"key": "value" (note: single space after the colon).

aSB.Append(" : ");

I'd be happy to make a PR but wanted to

  • ask what you think about this and
  • whether you'd be open to changing the default to "key": "value"
  • in case this would need to be optional, what a good name for that mode would be
@Bunny83
Copy link
Owner

Bunny83 commented Nov 20, 2020

Sorry for the late response. While I do understand that there are different styles out there, I don't really see a reason to change it. Changing the style may just cause trouble for some people who may have stored files locally and saved a hash of the content to detect changes.

A setting would be possible but there are too many different potential ways how you could format it. The framework has already outgrown the initial idea of being "simple" ^^. So I don't want to introduce tons of formatting settings and special cases.

@hybridherbst
Copy link
Author

hybridherbst commented Nov 20, 2020

Understood.

(For some context: we were seeing this as an issue with tools that modify the manifest.json directly, which introduced a lot of version control noise since SimpleJSON changed every ": " to " : ". We have fixed that locally in that tooling but I thought it might be a reasonable request to have more "external" control over formatting here.)

Oh, and I think compared to nearly every other JSON library on the planet SimpleJSON is, indeed, very simple, and thus awesome for many use cases :)

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