-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
SJSON support #1024
Comments
http://help.autodesk.com/view/Stingray/ENU/?guid=__stingray_help_managing_content_sjson_html Implements the following via Parse and Write flags: - The equal sign is used to define key-value pairs instead of the colon : - Quotes around strings in key-value pairs are optional - Commas are optional in object and array definitions - Each SJSON file is interpreted as a definition of a single object. Allowing of comments was already implemented.
@1354092549 What are the exact reasons to be compatible with javascript? I don't see how json5 is better to be in rapidjson than sjson. Both are "unofficial" extensions to json, and both could have their users if implemented in rapidjson. |
@andrusha97 If you just need to be simple,why not use YAML? |
And it's very surprising that it is called JSON but isn't compatible with JavaScript |
SJSON is very similar to JSON, although cannot be directly interpreted in Javascript. The intention of all these 'extensions' to JSON is to make it more human readable/editable, and many of the differences from JSON between them are similar. They could be implemented as small additional features on the rapidjson parser/writers, and combinations of flags can be used to implement different flavors of these extensions (see my PR #1025). Also, I (unfortunately) don't have a choice on which format to use. The data I have read/write is in SJSON format, and I want to code in C++ (there already is a SJSON parser for Javascript). Since rapidjson could support this with small modifications, it seemed like a natural choice. I can use that PR as a library in my project, but I would love to have this functionality in an official branch. |
SJSON is "Simplified JSON", which is a format used in some Autodesk products.
http://help.autodesk.com/view/Stingray/ENU/?guid=__stingray_help_managing_content_sjson_html
The SJSON format has the following differences from standard JSON:
// begins a single-line comment that causes everything to be ignored until the end of the line;
/* ... */ creates a multi-line comment that causes everything between the asterisks to be ignored.
This has some overlap with a relaxed JSON #36 implementation. Comments are already implemented, and keys without quotes are also part of relaxed JSON.
https://github.com/Autodesk/sjson
The text was updated successfully, but these errors were encountered: