cuelang.org/go@v0.13.0/encoding/openapi/testdata/omitvalue.txtar (about)

     1  -- in.cue --
     2  #D: {
     3  	a: int
     4  	#b: int
     5  	a_value: int
     6  	// Only definitions ending in _value are omitted.
     7  	#b_value: int
     8  	"a b_value": int
     9  }
    10  
    11  -- out/TestGenerateOpenAPI/out.json --
    12  {
    13     "openapi": "3.0.0",
    14     "info": {
    15        "title": "Generated by cue.",
    16        "version": "no version"
    17     },
    18     "paths": {},
    19     "components": {
    20        "schemas": {
    21           "D": {
    22              "type": "object",
    23              "required": [
    24                 "a",
    25                 "a_value",
    26                 "a b_value"
    27              ],
    28              "properties": {
    29                 "a": {
    30                    "type": "integer"
    31                 },
    32                 "a_value": {
    33                    "type": "integer"
    34                 },
    35                 "a b_value": {
    36                    "type": "integer"
    37                 }
    38              }
    39           },
    40           "D.b": {
    41              "type": "integer"
    42           }
    43        }
    44     }
    45  }