# libtmux.query.decode_json

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Lua
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/lua/libtmux/query.lua#L25
- **Page:** https://libtmux.org/en/lua/v0.1.1/reference/libtmux-query-decode_json/

```
decode_json: fun(
  schema: libtmux.QuerySchema,
  text: string,
  codec: table,
):libtmux.Where?, libtmux.QueryError?
```

Decode and validate a complete JSON query; never evaluate received code.

## Parameters

- `schema` (`libtmux.QuerySchema`)
- `text` (`string`)
- `codec` (`table`): A trusted lunajson-compatible encoder and SAX parser.

## Guides

Pages that discuss `decode_json`.

- [Query captured data](/en/lua/v0.1.1/guides/query/)
