如何使JSON模式识别对象的层次结构?

如何使JSON模式识别对象的层次结构?,json,hierarchy,jsonschema,Json,Hierarchy,Jsonschema,我正在为JSON编写一个模式。假设我有一个叫做“feature”的对象。在这个对象中定义了各种属性,其中一个是“features”,它是包含另一组“feature”的数组。因此,层级实际上是无限的 { "name": "feature", "properties": { "feature_name": { "type": "string", "description": "Name of feature", "required": true

我正在为JSON编写一个模式。假设我有一个叫做“feature”的对象。在这个对象中定义了各种属性,其中一个是“features”,它是包含另一组“feature”的数组。因此,层级实际上是无限的

{
  "name": "feature",
  "properties": {
    "feature_name": {
      "type": "string",
      "description": "Name of feature",
      "required": true
    },
    "feature_type": {
      "type": "string",
      "description": "Type of feature",
      "required": true
    },
    "features": {
      "type": "array",
      "items": {
        //How do I define the same object for an infinite hierarchy?
      }
    }
  }
}

“features”数组可以由更多的“feature”对象组成,每个对象也可能有更多的“features”。我能在JSON模式中适应这一点吗?

您可能无法实现无限层次结构。JSON.net似乎是解决这类问题的较好解决方案之一。

您可能无法实现无限层次结构。JSON.net似乎是解决这类问题的更好的解决方案之一。

这正是我所担心的,而.net对我来说不起作用,因为我只是在用Delphi编写的一组基于web的应用程序中使用JSON结构。这正是我所担心的,net对我来说不起作用,因为我只是在用Delphi编写的一组基于web的应用程序中使用JSON结构。