Marcel van Lohuizen | 75cb003 | 2019-01-11 12:10:48 +0100 | [diff] [blame^] | 1 | [TOC](Readme.md) [Prev](json.md) [Next](commas.md) |
| 2 | |
| 3 | # Quotes are Optional for Field Names |
| 4 | |
| 5 | JSON objects are called structs in CUE. |
| 6 | An object member is called a field. |
| 7 | |
| 8 | |
| 9 | Double quotes may be omitted from field names if their name contains no |
| 10 | special characters and does not start with a number: |
| 11 | |
| 12 | <!-- CUE editor --> |
| 13 | ``` |
| 14 | { |
| 15 | one: 1, |
| 16 | two: 2, |
| 17 | "two-and-a-half": 2.5 |
| 18 | } |
| 19 | ``` |
| 20 | |
| 21 | <!-- JSON result --> |
| 22 | ```json |
| 23 | { |
| 24 | "one": 1, |
| 25 | "two": 2, |
| 26 | "two-and-a-half": 2.5 |
| 27 | } |
| 28 | ``` |