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

     1  -- in.cue --
     2  package ext
     3  
     4  import "mod.test/blocks"
     5  
     6  #Blocks: {
     7  	block1: blocks.#Block
     8  }
     9  
    10  -- out/TestGenerateOpenAPI/out.json --
    11  {
    12     "openapi": "3.0.0",
    13     "info": {
    14        "title": "Generated by cue.",
    15        "version": "no version"
    16     },
    17     "paths": {},
    18     "components": {
    19        "schemas": {
    20           "Block": {
    21              "type": "object",
    22              "required": [
    23                 "a",
    24                 "b"
    25              ],
    26              "properties": {
    27                 "a": {
    28                    "type": "number",
    29                    "minimum": 50,
    30                    "exclusiveMinimum": true
    31                 },
    32                 "b": {
    33                    "type": "number",
    34                    "maximum": 10,
    35                    "exclusiveMaximum": true
    36                 }
    37              }
    38           },
    39           "Blocks": {
    40              "type": "object",
    41              "required": [
    42                 "block1"
    43              ],
    44              "properties": {
    45                 "block1": {
    46                    "$ref": "#/components/schemas/Block"
    47                 }
    48              }
    49           }
    50        }
    51     }
    52  }