# How to create recursive schema

**URL:** <https://jsonforms.discourse.group/t/how-to-create-recursive-schema/408>\
**Category:** General\
**Created:** [September 23, 2021, 5:47pm UTC](https://jsonforms.discourse.group/t/how-to-create-recursive-schema/408 "2021-09-23T17:47:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoHcmp](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/mohcmp/32/108_2.png) [@MoHcmp](https://jsonforms.discourse.group/u/MoHcmp)\
**Post date:** [September 23, 2021, 5:47pm UTC](https://jsonforms.discourse.group/t/how-to-create-recursive-schema/408/1 "2021-09-23T17:47:40Z")

</div>

Hello. I’m trying to create recursive schema, but it does not work. Does jsonform support recursive schemas? If yes do i have mistake in my schema?

example schema:

```auto
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "children": {
      "type": "array",
      "items": {
        "$ref": "#"
      }
    }
  }
}

```

uiSchema:

```auto
{
  "type": "VerticalLayout",
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/title"
    },
    {
      "type": "Control",
      "scope": "#/properties/children"
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![alastair-todd](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/alastair-todd/32/160_2.png) [@alastair-todd](https://jsonforms.discourse.group/u/alastair-todd)\
**Post date:** [September 24, 2021, 1:43pm UTC](https://jsonforms.discourse.group/t/how-to-create-recursive-schema/408/2 "2021-09-24T13:43:43Z")

</div>

array needs to be represented in the ui schema as such

```json
{
  "type": "VerticalLayout",
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/costCentres",
      "options": {
        "detail": {
          "type": "VerticalLayout",
          "elements": [
            {
              "type": "Control",
              "scope": "#/properties/costAccount"
            },
            {
              "type": "Control",
              "scope": "#/properties/costDepartment"
            },
            {
              "type": "Control",
              "scope": "#/properties/allocation"
            }
          ]
        }
      }
    }
  ]
}
```

---

<div class="post-metadata">

**Author:** ![MoHcmp](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/mohcmp/32/108_2.png) [@MoHcmp](https://jsonforms.discourse.group/u/MoHcmp)\
**Post date:** [September 24, 2021, 2:27pm UTC](https://jsonforms.discourse.group/t/how-to-create-recursive-schema/408/3 "2021-09-24T14:27:37Z")

</div>

are you replying to my question?

---

<div class="post-metadata">

**Author:** ![MoHcmp](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/mohcmp/32/108_2.png) [@MoHcmp](https://jsonforms.discourse.group/u/MoHcmp)\
**Post date:** [September 27, 2021, 9:30am UTC](https://jsonforms.discourse.group/t/how-to-create-recursive-schema/408/4 "2021-09-27T09:30:21Z")

</div>

@sdirix Hello. Can you help me, please?

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [September 29, 2021, 5:02pm UTC](https://jsonforms.discourse.group/t/how-to-create-recursive-schema/408/5 "2021-09-29T17:02:54Z")

</div>

Hi @MoHcmp, as indicated in the [welcome post](https://jsonforms.discourse.group/t/welcome-to-the-json-forms-discourse/7/3), our time for free support is limited. Usually we answer within a few days, however the exact point depends on our work load and the topics we’re working on. If you are interested in professional support with a guaranteed support time please see [here](https://jsonforms.io/support).

Now when you ask a question it would be helpful to:

- mention binding and renderer set (e.g. React and Material UI)
- the version which has the problem (e.g. latest stable or next preview build)
- what exactly the problem is that you’re having

I checked your example with the latest stable and preview builds of React Material UI. In the latest stable build (`2.5.2`) it works perfectly fine. The preview build (`3.0.0-alpha.1`) seems to be partially broken (i.e. it adds arrays within arrays when adding children instead of objects), which makes sense as we recently overhauled the reference mechanism and [we know that there are some issues left](https://github.com/eclipsesource/jsonforms/issues/1750#issuecomment-862365570).  
So if that is the problem you have, then we’re already working on it and intend to fix it before the stable 3.0 release. If not, then please describe your problem in more detail.
