cuelang.org/go@v0.10.1/encoding/jsonschema/testdata/openapi.txtar (about)

     1  #openapi
     2  
     3  -- type.yaml --
     4  components:
     5    schemas:
     6      User:
     7        description: "A User uses something."
     8        type: object
     9        properties:
    10          id:
    11            type: integer
    12          name:
    13            type: string
    14          address:
    15            $ref: "#/components/schemas/PhoneNumber"
    16            nullable: true
    17      PhoneNumber:
    18        description: "The number to dial."
    19        type: string
    20  
    21  -- out/decode/cue --
    22  // A User uses something.
    23  #User: {
    24  	id?:   int
    25  	name?: string
    26  	address?:
    27  		null | #PhoneNumber
    28  	...
    29  }
    30  
    31  // The number to dial.
    32  #PhoneNumber: string