github.com/solo-io/cue@v0.4.7/encoding/openapi/testdata/openapi.cue (about)

     1  // An OpenAPI testing package.
     2  package openapi
     3  
     4  $version: "v1beta2"
     5  
     6  info: {
     7  	contact: url:  "https://cuelang.org"
     8  	contact: name: "John Doe"
     9  }
    10  
    11  // MyMessage is my message.
    12  #MyMessage: {
    13  	port?: #Port & {} @protobuf(1)
    14  
    15  	foo: #Int32 & >10 & <1000 & int32 @protobuf(2)
    16  
    17  	bar: [...string] @protobuf(3)
    18  }
    19  
    20  #MyMessage: {
    21  	// Field a.
    22  	a: 1
    23  } | {
    24  	b: string //2: crash
    25  }
    26  
    27  #YourMessage: ({a: number} | {b: string} | {b: number}) & {a?: string}
    28  
    29  #YourMessage2: ({a: number} | {b: number}) &
    30  	({c: number} | {d: number}) &
    31  	({e: number} | {f: number})
    32  
    33  #Msg2: {b: number} | {a: string}
    34  
    35  #Int32: int32
    36  
    37  #Enum: "foo" | "bar" | "baz"
    38  
    39  #List: [...number] | *[1, 2, 3]
    40  
    41  #DefaultStruct: #Port | *{port: 1}
    42  
    43  #Port: {
    44  	port: int
    45  
    46  	obj: [...int]
    47  }