tauri-apps/tauri
tauri-schema-generator
Active contributors: Lucas Fernandes Nogueira, Amr Bashir
Purpose
crates/tauri-schema-generator is a small binary crate that derives JSON Schemas for everything Tauri consumes as JSON: tauri.conf.json, capabilities, and plugin permission files. The generated schemas are checked into the repo so editors (VS Code's json.schemas, JetBrains, etc.) can validate user files against them, and so the tauri-schema-worker Cloudflare Worker can serve them at https://schema.tauri.app.
CI workflow check-generated-files.yml re-runs this binary on every PR and fails if the generated artefacts diverge from what's checked in.
Directory layout
crates/tauri-schema-generator/
├── Cargo.toml
├── README.md
├── build.rs
├── schemas/ # Generated JSON Schema outputs (canonical copies)
│ ├── config.schema.json
│ └── (acl schemas)
└── src/
└── main.rs # walks the relevant tauri-utils types and writes schemasHow it works
The crate enables tauri-utils's schema feature, which derives schemars::JsonSchema for every config and ACL type. main.rs then calls schemars to produce JSON, post-processes it (Tauri uses a patched fork of schemars to preserve docstring newlines — see the [patch.crates-io] block in the workspace Cargo.toml), and writes the files to:
crates/tauri-schema-generator/schemas/(canonical copy that the schema worker bundles).crates/tauri-cli/config.schema.json(CLI-mirrored copy).crates/tauri-cli/tauri.config.schema.json,crates/tauri-cli/schema.json.
graph LR
Types["tauri-utils types<br/>(Config, Capability, Permission)"] -->|"#[derive(JsonSchema)]"| Gen["tauri-schema-generator"]
Gen -->|"writes JSON"| RepoFiles["repo-checked schemas"]
RepoFiles -->|"served by"| Worker["tauri-schema-worker"]Run it
cargo run -p tauri-schema-generatorAlways run this after editing config or ACL types in crates/tauri-utils/.
Integration points
- Up: invoked by developers locally and by CI.
- Down: depends on
tauri-utilswith theschemafeature.
See tauri-utils for the source types and tauri-schema-worker for the deployment side.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.