# IDE Support (JSON Schemas)

The Connect JSON Schema toot is a tool that generates JSON Schema from Kafka Connect connector, Single Message Transforms and Secret Provider configurations. It helps validate and document connector configurations by providing a standardized schema format that can be used for validation and documentation purposes.

Many IDE's support JSON schemas allowing for intellisense and auto completion. For VS code you can find out more information [here](https://code.visualstudio.com/docs/languages/json).

* Generates JSON Schema from any Kafka Connect Connector, SMT or Secret Provider JAR
* Includes all connector configuration fields with types and descriptions
* Includes default Kafka Connect fields.

<a href="https://github.com/lensesio/json-schemas/kafka-connectors" class="button primary">JSON Schemas</a>      <a href="https://github.com/lensesio/connector-json-schema-tool" class="button primary">Generator Tool</a>

{% hint style="warning" %}
Beta - The Schemas are still beta and can change and are currently for the latest version of the Stream Reactor connector.
{% endhint %}

The  `Generator Tool` will generate JSON schemas from jars containing classes implementing:

* Sink Connector
* Source Connector
* Single Message Transforms
* Secret Providers

In addition it can also merge the individual connectors schemas into a Union schema.&#x20;

{% hint style="success" %}
Optionally it can then include overrides for Connect converters (header, key & value) and consumer and producers.
{% endhint %}

## Usage

To triggered the default snippets at the root level start typing:

* Connectors: for connector examples
* Overrides: for converters, consumer & producer

You can type further to get default snippets for different connector types, e.g. AWS S3.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FETXWnZknWA8VhF6SwqCx%2Fuploads%2F5FUokNSPxIf8krUMaea5%2Fjson-schema-connectors.mp4?alt=media&token=b267b9c7-dbbb-44a9-8d16-a4c208cbd978>" %}
Connect JSON Schema Default Snippets
{% endembed %}

## VS Code Setup

Once you have JSON schema you can enable JSON Schema validation and auto completion in VS Code for both JSON and YAML files:

{% stepper %}
{% step %}
Install the required VS Code extensions

* "YAML" by Red Hat
* "JSON Language Features" (built-in)
  {% endstep %}

{% step %}
Configure VS Code settings:

* Open VS Code settings (Ctrl+,)
* Add the following configuration to your `settings.json`:

```json
{
    "yaml.schemas": {
        "file:///path/to/your/schema.json": ["*.yaml", "*.yml"]
    },
    "json.schemas": [
        {
            "fileMatch": ["*.json"],
            "url": "file:///path/to/your/schema.json"
        }
    ],
    "yaml.format.enable": true,
    "yaml.validate": true,
    "yaml.hover": true,
    "yaml.completion": true,
    "yaml.format.singleQuote": false,
    "yaml.format.bracketSpacing": true,
    "yaml.format.proseWrap": "preserve"
}
```

Replace `/path/to/your/schema.json` with the actual path to your schema file.
{% endstep %}

{% step %}
For project-specific settings, create a `.vscode/settings.json` file in your project root:

```json
{
    "yaml.schemas": {
        "file://${workspaceFolder}/schema.json": ["*.yaml", "*.yml"]
    },
    "json.schemas": [
        {
            "fileMatch": ["*.json"],
            "url": "file://${workspaceFolder}/schema.json"
        }
    ]
}
```

{% endstep %}
{% endstepper %}

This setup will provide:

* Schema validation for both JSON and YAML files
* Auto completion for connector configurations
* Hover documentation for fields
* Formatting support for YAML files
* Project-specific schema configuration


---

# 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://docs.lenses.io/latest/connectors/ide-support-json-schemas.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.
