A VS Code extension for JSON Schema validation, powered by the Rust engine jsonschema by Stranger6667.
Validates your JSON files automatically as you work. No configuration needed if your file includes a $schema key.
curl -L https://github.com/adityakumar37/rustschema/releases/download/v0.0.1/rustschema-0.0.1.vsix -o rustschema.vsix && code --install-extension rustschema.vsix- Go to Releases
- Download
rustschema-0.0.1.vsix - Run:
code --install-extension rustschema-0.0.1.vsixgit clone https://github.com/adityakumar37/rustschema
cd rustschema
npm install
npm run compilePress F5 in VS Code to run.
Install Rust and jsonschema-cli before using the extension.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install jsonschema-cliAdd a $schema key to your JSON file:
{
"$schema": "./schema.json",
"name": "John",
"age": 25
}RustSchema reads the key, finds the schema, and validates automatically on open and save.
Press Cmd + Shift + P → type RustSchema: Validate JSON against Schema
If you prefer not to add $schema to your files, set a global schema path:
- Open Settings (
Cmd + ,) - Search
rustschema - Set
RustSchema: Schema Pathto the path of your schema relative to the workspace root
schema.json
{
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "number" }
},
"required": ["name", "age"]
}data.json
{
"$schema": "./schema.json",
"name": 123,
"age": "wrong"
}Problems panel shows:
1. 123 is not of type "string"
2. "wrong" is not of type "number"
- Draft switcher — switch between JSON Schema drafts (4, 6, 7, 2019-09, 2020-12) and compare validation results
- Inline error highlighting on the exact line
- Schema auto-discovery across the workspace
- Publish to VS Code Marketplace
Contributions are welcome. If you have an idea, found a bug, or want to implement something from the roadmap, open an issue or submit a pull request.
git clone https://github.com/adityakumar37/rustschema
cd rustschema
npm installPress F5 to launch the Extension Development Host and start testing.
The validation engine is jsonschema by Dmitry Dygalo, licensed under MIT.
MIT