> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/~/changes/VuchuDyabVa3NSXAKjpZ/decision-tables/input-and-output/json-editor.md).

# JSON Editor

## Working with the JSON Editor

<figure><img src="/files/gNAsLqoUZ94z67CjjuzN" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
All the changes are made to the current table version.
{% endhint %}

{% hint style="info" %}
There are no limitations in creating Input/Output model. A model can have unlimited root objects and unlimited children.&#x20;
{% endhint %}

{% hint style="warning" %}
Make sure you're saving your changes by pressing the ![](/files/hlaAHFJ4IAatsgNpnTXF) button in the bottom right corner.
{% endhint %}

### Creating a Model

The Model has the same structure as a tree and should be written in JSON format. There are root objects that contain children, but only leaf objects (objects without children) can be selected as variables.

#### There is only one option on how to create a leaf object:

* Object with empty **{}**: `"object": {}`

{% hint style="warning" %}
Arrays and values are not allowed.
{% endhint %}

#### Example of a simple model with leaves only:

```javascript
{
    "distance": {},
    "tariff": {},
    "weight": {},
    "longestSide": {}
}
```

#### Example of a complex model:

```javascript
{
  "delivery": {
    "distance": {
      "car": {},
      "ship": {},
      "plane": {}
    },
    "tariff": {}
  },
  "package": {
    "weight": {},
    "longestSide": {}
  }
}
```

### Beautify Code

The button ![](/files/-MQWB2YKw7NfX_blrF6M) will change your written code to a better readable format.

{% hint style="info" %}
This functionality is especially useful when **copying and pasting** JSON from another source or window on your device.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decisionrules.io/doc/~/changes/VuchuDyabVa3NSXAKjpZ/decision-tables/input-and-output/json-editor.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
