> 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

Editor for experienced users who have experience with the structure of JSON objects.

## Working with the JSON Editor

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FSywMGAbVKgWgfsWtn10x%2Fimage.png?alt=media&amp;token=5d503288-3aaa-4115-9382-81c8a7321836" 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 ![](https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FSRmBHSFDwh3WiA8brAmk%2Fimage.png?alt=media\&token=0658deed-4a06-424c-bbbe-b057eff568b8) 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 ![](https://437457296-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MN4F4-qybg8XDATvios%2F-MQWA_Ovz7zKDsTcoFnk%2F-MQWB2YKw7NfX_blrF6M%2Fscreenshoteasy%20\(14\).png?alt=media\&token=2b24a21d-159e-437b-84d0-1788e48fb92e) 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
