---
title: "Json Schema"
manual: "Content Blocks"
version: "main"
permalink: "https://docs.typo3.org/permalink/friendsoftypo3/content-blocks:json-schema@main"
source: "JsonSchema/Index.rst"
rendered: "2026-09-22T14:15:39+00:00"
---

# Json Schema {#json-schema}

<!-- TODO: no Markdown rendering for "versionadded" -->

Since Content Blocks is based on a YAML definition, it is possible to validate
it against a [JSON Schema](https://json-schema.org/). The schema is
shipped directly inside the Content Blocks extension and updated in each new
releases accordingly. It is located in the root folder "JsonSchema":

> [!NOTE]
> This feature was voted for as part of the [Community Budget Ideas 2026 Round One](https://talk.typo3.org/t/content-blocks-json-schema-yaml-linter-nikita-hovratov/6593)

-   `content-blocks`
    -   `JsonSchema`
        -   `basic.schema.json`
        -   `content-element.schema.json`
        -   `file-type.schema.json`
        -   `page-type.schema.json`
        -   `record-type.schema.json`

As you can see, each content type brings its own schema. Even [Basics](https://docs.typo3.org/permalink/friendsoftypo3/content-blocks:basics@main)
have their own schema, as they are separate YAML files.

## Usage {#usage}

### Lint Command {#lint-command}

The most simple usage is the integrated [lint command](https://docs.typo3.org/permalink/friendsoftypo3/content-blocks:command-lint@main):

```bash
vendor/bin/typo3 content-blocks:lint
```

Running this command will reveal configuration errors of all loaded Content
Blocks. Use this in your CI pipeline to ensure you don't introduce incorrect
configuration.

> [!NOTE]
> This command only works in composer-mode.

### IDE Integration {#json-schema-ide}

When writing Content Blocks configuration, an IDE integration of the JSON Schema
will help you with auto-completion and realtime linting.

#### PhpStorm {#phpstorm}

Open PhpStorm and switch to File > Preferences > Languages & Frameworks > Schemas and DTDs > JSON Schema Mappings.
Then, select the local json file for "Schema file or URL" in your vendor/friendsoftypo3/content-blocks or typo3conf/ext/content_blocks folder.
Lastly, create a new "File path Pattern". For example: `**/ContentBlocks/ContentElements/*/config.yaml`.
Do this for each type you want validation for. Unfortunately, you have to repeat
these steps for each new project.

Overview:

| Content Type | Schema file | File path Pattern |
| --- | --- | --- |
| Content Elements | JsonSchema/content-element.schema.json | \*\*/ContentBlocks/ContentElements/\*/config.yaml |
| Page Types | JsonSchema/page-type.schema.json | \*\*/ContentBlocks/PageTypes/\*/config.yaml |
| Record Types | JsonSchema/record-type.schema.json | \*\*/ContentBlocks/RecordTypes/\*/config.yaml |
| File Types | JsonSchema/file-type.schema.json | \*\*/ContentBlocks/FileTypes/\*/config.yaml |
| Basics | JsonSchema/basic.schema.json | \*\*/ContentBlocks/Basics/\*.yaml |

#### Visual Studio Code {#visual-studio-code}

1.  Install the plugin "redhat.vscode-yaml"
1.  Open the settings and search for "yaml schemas" and open the settings.json.
1.  Add the following config (adjust the local path accordingly)

```json
{
    "yaml.schemas": {
        "vendor/friendsoftypo3/content-blocks/JsonSchema/content-element.schema.json" : ["**/ContentBlocks/ContentElements/*/config.yaml"],
        "vendor/friendsoftypo3/content-blocks/JsonSchema/page-type.schema.json" : ["**/ContentBlocks/PageTypes/*/config.yaml"],
        "vendor/friendsoftypo3/content-blocks/JsonSchema/record-type.schema.json" : ["**/ContentBlocks/RecordTypes/*/config.yaml"],
        "vendor/friendsoftypo3/content-blocks/JsonSchema/file-type.schema.json" : ["**/ContentBlocks/FileTypes/*/config.yaml"],
        "vendor/friendsoftypo3/content-blocks/JsonSchema/basic.schema.json" : ["**/ContentBlocks/Basics/*.yaml"]
    }
}
```
