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

     1  -- type.yaml --
     2  openapi: 3.0.0
     3  info:
     4    title: Users schema
     5    version: v1beta1
     6    contact:
     7      name: The CUE Authors
     8      url: https://cuelang.org
     9  
    10  components:
    11    schemas:
    12      User:
    13        description: "A User uses something."
    14        type: object
    15        properties:
    16          id:
    17            type: integer
    18          name:
    19            type: string
    20          address:
    21            $ref: "#/components/schemas/PhoneNumber"
    22      PhoneNumber:
    23        description: "The number to dial."
    24        type: string
    25  
    26  -- out.cue --
    27  // Users schema
    28  package foo
    29  
    30  info: {
    31  	title:   *"Users schema" | string
    32  	version: *"v1beta1" | string
    33  	contact: {
    34  		name: "The CUE Authors"
    35  		url:  "https://cuelang.org"
    36  	}
    37  }
    38  // A User uses something.
    39  #User: {
    40  	id?:      int
    41  	name?:    string
    42  	address?: #PhoneNumber
    43  	...
    44  }
    45  
    46  // The number to dial.
    47  #PhoneNumber: string