Skip to content

Commit 895f3c6

Browse files
committed
docs: updates docs for json-schema
1 parent b2f24e1 commit 895f3c6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/getting-started/ide-integration.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,35 @@
33
To get the best experience when working with Context Generator configuration files, you can use the JSON schema for
44
autocompletion and validation in your IDE:
55

6+
## Using schema definition in configuration files
7+
8+
The easiest way to enable IDE validation and autocompletion is to define the `$schema` property directly in your
9+
configuration file. This approach works in most modern IDEs without requiring additional setup.
10+
11+
### YAML Configuration with Schema
12+
13+
```yaml
14+
$schema: 'https://raw.githubusercontent.com/context-hub/generator/refs/heads/main/json-schema.json'
15+
documents:
16+
...
17+
```
18+
19+
### JSON Configuration with Schema
20+
21+
```json
22+
{
23+
"$schema": "https://raw.githubusercontent.com/context-hub/generator/refs/heads/main/json-schema.json",
24+
"documents": [
25+
...
26+
]
27+
}
28+
```
29+
30+
> **Note:** `ctx init` commands will automatically add the `$schema` property to generated configuration files.
31+
32+
This approach eliminates the need for manual schema downloads or complex IDE configurations, making it the recommended
33+
method for integrating schema validation into your workflow.
34+
635
## Download the schema
736

837
```bash

0 commit comments

Comments
 (0)