# Load Json

### Signature

```csharp
table loadJson(string path)
```

### Description

Reads a JSON file from a specific path and deserializes its contents into a table.

Returns a table or `nil` if the file is empty or could not be found.

### Arguments

#### Path

The path of the file to be loaded.

Absolute paths are supported and relative paths start from `{game}\x64\`.

### Example

#### Load Config

```lua
local data = config.loadJson(config.path .. "/mymod-config.json")
```

#### Input

{% code title="mymod-config.json" fullWidth="false" %}

```json
{
    "model": 6488064,
    "name": "Vaan"
}
```

{% endcode %}

### Notes

{% hint style="warning" %}
Only the following value types are supported: `table`, `string`, `double`, `integer`, `bool`.
{% endhint %}

{% hint style="info" %}
Unless a table starts at 1, increases sequentially without gaps, and contains only integer keys, it cannot be reliably traversed in a certain order in Lua.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://xeavin.gitbook.io/ff12-lua-loader/config/functions/load-json.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
