-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
std.json5 #8875
std.json5 #8875
Conversation
Thanks for your pull request, @quickfur! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#8875" |
I would not want to merge this, for the same reasons as stated before This belongs in a dub package. |
Oh I see. Nevermind then. |
The same can be said of std.json. If we're going to commit to maintaining a mistake, shouldn't it be done in the name of user-friendliness? |
I don't disagree. The fact that this list is so long is evidence that std.json just isn't enough: https://code.dlang.org/search?q=json But note that even on top of that, this module is much less comprehensive than even std.json -- it basically provides no mechanism to properly serialize json5, nor does it tell you the original format of the thing that you deserialized. I think dub is the right place for these kinds of projects. It's unfortunate that std.json isn't already there, and I don't know if we'll ever move it. |
Wouldn't you just use regular JSON for serialization? Since it's a subset of JSON5, it will be compatible. |
Yes, if you don't care about removing comments, changing how people have put in numbers, etc. If you are just parsing, then it might be OK. But writing out the data you should have options if you support json5. A single public function like |
I think the general expectation is that parsers throw away comments, and don't preserve the exact representation (e.g. which string literal syntax was used). |
This is a rebase of #8806 on master, and rename of std.json to std.json5 while restoring the original std.json, as requested by reviewers.