react-json-editor-ajrm
react-json-editor-ajrm copied to clipboard
Force reformatting to always put double quotes around keys
- What version of RJEA are you using (react-json-editor-ajrm version)? *REQUIRED 2.5.8
- What operating system and processor architecture are you using? *REQUIRED MacOS Sierra
- What did you do? *REQUIRED I copy/pasted this json:
{
"a": 2,
"xxx": "Hi"
}
- What did you expect to see? *REQUIRED I expected to have the json in the editor formatted but still keeping the quotes around the key names
- What did you see instead? *REQUIRED The keys lose the quotes around them. This creates problem for users that want to copy from the editor and paste the json object elsewhere. Is there a option to keep the quotes around the keys?
Hello @StefanoSega
Thanks for reporting this. As you noticed this is currently intended behavior. Quotes are only added if required (e.g. due to a space in the key name).
I'll flag this as feature request and maybe we'll get to it at some point in the future. However we're in dire need of collaborators so I cannot give you an estimated timeframe.
Extra vote here. We have the same issue, so would be glad if this is changed. It's not just a visualisation issue, it's very important to have strict JSON to be able to copy/paste between systems.
Double quotes are required according to the strict JSON standard:
- http://www.json.org/
- https://jsonlint.com/
Make sure you follow JSON's syntax properly. For example, always use double quotes, always quotify your keys, and remove all callback functions.
- https://stackoverflow.com/questions/949449/do-the-json-keys-have-to-be-surrounded-by-quotes
Quotes are also changed to single quotes, which is also not valid strict JSON.
i need this issue to solve too . I think it will be great if it can still accept double quote mark so it did not confuse someone that familiar with JSON standard
Note that it would also be OK if COPY (from copy/paste) would add these single/double quotes for keys and PASTE would remove them if they were in.
Hello! +100500 quotes to this. It is critical functional for json editor. For now it is not JSON editor. It is just JS-object editor. It converts json to js forcibly and not configurable and after this you edit js-object and not json. Unable to copy past and verify json with this JS editor because of that. Seeing this issue and it's date and thinking we now need to find something different. People past real valid json into this editor and complain because of parse errors - it's a bug.
This is valid feedback. I will see if we can have this updated.
Hi, Was this fixed? Facing the same issue here!
Hi @AndrewRedican ,
Any updates on the issue? Still seeing the same issue.
First of all, awesome project!
Any progress on this though? Currently this JSON editor doesn't accept or show JSON, it shows javascript objects.
placeholder={JSON.stringify({a:1})} should not fail.
all keys should be doublequote-wrapped.
If the project were called "Javascript Object Editor" There'd be no issue 😄
thanks for you work!
I no longer intend to update this project. I am working instead on a complete rewrite.
I'd like to thank you for using and taking interest in this project.
I also would like to apologize for not following up sooner. However, do realize for the most part this has been a one-man show, and the occasional contributions I used to receive. What I am saying is, I am in dire need of volunteers.
If this is something you would be interested in participating in, you can join in the discussion.
I've taken note of this thread, and I'll keep this under consideration for the new project.