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

     1  -- type.json --
     2  {
     3    "type": "object",
     4  
     5    "properties": {
     6      "constant":  { "const": 2 },
     7      "several": {
     8        "enum": [ 1, 2, 3, 4 ]
     9      },
    10      "inclusive": {
    11          "type": "number",
    12          "minimum": 2,
    13          "maximum": 3
    14      },
    15      "exclusive": {
    16          "type": "integer",
    17          "exclusiveMinimum": 2,
    18          "exclusiveMaximum": 3
    19      },
    20      "multi": {
    21          "type": [ "integer", "string" ],
    22          "minimum": 2,
    23          "maximum": 3,
    24          "maxLength": 5
    25      },
    26      "legacy": {
    27          "type": "number",
    28          "exclusiveMinimum": true,
    29          "minimum": 2,
    30          "exclusiveMaximum": true,
    31          "maximum": 3
    32      },
    33      "cents": {
    34        "type": "number",
    35        "multipleOf": 0.05
    36      }
    37    },
    38    "additionalProperties": false
    39  }
    40  
    41  -- out.cue --
    42  import (
    43  	"strings"
    44  	"math"
    45  )
    46  
    47  constant?:  2
    48  several?:   1 | 2 | 3 | 4
    49  inclusive?: >=2 & <=3
    50  exclusive?: int & >2 & <3
    51  multi?:     int & >=2 & <=3 | strings.MaxRunes(5)
    52  legacy?:    >2 & <3
    53  cents?:     math.MultipleOf(0.05)