-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-document-in-relaxed-form.json
More file actions
32 lines (25 loc) · 1.44 KB
/
example-document-in-relaxed-form.json
File metadata and controls
32 lines (25 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* This is an example of a JSON document in a format supported by libujson when parsing in relaxed mode.
*
* C/C++-style comments are allowed and ignored by libujson when parsing a JSON document in relaxed mode.
* So no comments will be written when using the API to print JSON instances.
*
*/
{
header: "A JSON document in 'relaxed' format.",
note_1: "As you can see, object member names doesn't have "
"to be enclosed by double quotes if they are written "
"in format: [_a-zA-Z][_a-zA-Z0-9]*",
"note_2": "A normal object member name enclosed in double quotes",
note_3: "This is a string value on " // This can be used to have input
"more than one line that, " // JSON documents in a more readable format.
"when parsed, will be one " // But when using libujson to print a
"single long line.", // JSON instance, strings will be
// printed as a single string on one line.
array_2: [1,2,3,4,5,6,7,8,9,], // An array definition can end with a separator (,)
// Object member names not in format [_a-zA-Z][_a-zA-Z0-9]* must still be enclosed by double quotes.
"~tilde": "Other value",
// true is a reserved word and if used as an object member name, it must be enclosed by double quotes.
"true": "Some value",
last_object_member: null, // The last object member can end with a separator (,)
}