...

Text file src/cuelang.org/go/encoding/jsonschema/testdata/emptyobj.txtar

Documentation: cuelang.org/go/encoding/jsonschema/testdata

     1// Objects without properties should convert correctly.
     2//
     3// Issue #734
     4-- github-workflow.json --
     5{
     6  "$schema": "http://json-schema.org/draft-07/schema",
     7  "definitions": {
     8    "obj1": {
     9      "oneOf": [
    10        {
    11          "type": "object"
    12        },
    13        {
    14          "type": "null"
    15        }
    16      ],
    17      "additionalProperties": true
    18    },
    19    "obj2": {
    20      "type": [ "object", "null" ],
    21      "additionalProperties": true
    22    }
    23  }
    24}
    25-- out.err --
    26-- out.cue --
    27@jsonschema(schema="http://json-schema.org/draft-07/schema")
    28_
    29
    30#obj1: null | {
    31	...
    32}
    33
    34#obj2: null | {
    35	...
    36}

View as plain text