github.com/solo-io/cue@v0.4.7/doc/tutorial/basics/0_intro/10_json.txt (about)

     1  cue export json.cue
     2  cmp stdout expect-stdout-cue
     3  
     4  -- frontmatter.toml --
     5  title = "JSON Superset"
     6  description = ""
     7  
     8  -- text.md --
     9  CUE is a superset of JSON.
    10  It adds the following conveniences:
    11  
    12  - C-style comments,
    13  - quotes may be omitted from field names without special characters,
    14  - commas at the end of fields are optional,
    15  - comma after last element in list is allowed,
    16  - outer curly braces are optional.
    17  
    18  <!--
    19  {{< alert color="info">}}
    20  CUE borrows a trick from Go to make commas optional:
    21  the formal grammar still requires commas,
    22  but the scanner inserts commas according to a small set
    23  of simple rules.
    24  {{< /alert >}}
    25  -->
    26  
    27  JSON objects are called structs in CUE.
    28  An object member is called a field.
    29  
    30  -- json.cue --
    31  one: 1
    32  two: 2
    33  
    34  // A field using quotes.
    35  "two-and-a-half": 2.5
    36  
    37  list: [
    38  	1,
    39  	2,
    40  	3,
    41  ]
    42  
    43  -- expect-stdout-cue --
    44  {
    45      "list": [
    46          1,
    47          2,
    48          3
    49      ],
    50      "one": 1,
    51      "two": 2,
    52      "two-and-a-half": 2.5
    53  }