lm-format-enforcer icon indicating copy to clipboard operation
lm-format-enforcer copied to clipboard

JsonParser Fails to Inherit Reference Object Type

Open NJordan72 opened this issue 1 year ago • 2 comments
trafficstars

Take the following JSON Schema

{
  "$defs": {
    "ParentObject": {
      "properties": {
          "child": {
             "type": "string"
          }
      },
      "type": "object"
    }
  },
  "properties": {
    "parent": {
      "$ref": "#/$defs/ParentObject"
    }
  }
}

We would expect this to inherit the object type from ParentObject but instead on input

{"parent": {"child": "test"}}'

we get Exception: Unsupported type None. To fix we have to declare an an object type directly.

NJordan72 avatar May 20 '24 17:05 NJordan72