|
|
(One intermediate revision by the same user not shown) |
Line 1: |
Line 1: |
| + | The content is now available at [http://docs.openstack.org/contributor-guide/json-conventions.html the Documentation Contributor Guide]. |
| + | |
| {{OpenStack_Documentation_Navbar}} | | {{OpenStack_Documentation_Navbar}} |
− | {{OpenStack_Conventions_Navbar}}
| |
− |
| |
− | == JSON formatting conventions ==
| |
− |
| |
− | Format JSON files to be human readable. Use four spaces for indentation (matching OpenStack conventions used in Python and shell scripts), and one space after the name-separator (colon). Obey the formal JSON format; in particular, strings are in double (not single) quotes.
| |
− |
| |
− | Sample files may have their keys ordered if that makes the file easier to understand. Automatic reformatting tools are to preserve the order of keys.
| |
| | | |
− | Example:
| + | ---- |
− | <pre><nowiki>
| + | [[Category:Documentation]] |
− | {
| |
− | "uuid": "d8e02d56-2648-49a3-bf97-6be8f1204f38",
| |
− | "availability_zone": "nova",
| |
− | "hostname": "test.novalocal",
| |
− | "launch_index": 0,
| |
− | "array0": [],
| |
− | "array1": [
| |
− | "low"
| |
− | ],
| |
− | "array3": [
| |
− | "low",
| |
− | "high",
| |
− | "mid"
| |
− | ],
| |
− | "object0": {},
| |
− | "object1": {
| |
− | "value": "low",
| |
− | "role": "some"
| |
− | },
| |
− | "name": "test"
| |
− | }
| |
− | </nowiki></pre>
| |
Latest revision as of 19:21, 26 October 2015
The content is now available at the Documentation Contributor Guide.