APIs for WebAssembly Interface Type (WIT) Development
The WIT Validate API provides tools to validate WebAssembly Interface Type (WIT) files for syntax, structure, and best practices.
Health check endpoint to verify API status.
curl -X GET https://witgen.dev/api/health
Validates WIT content provided in JSON format.
curl -X POST https://witgen.dev/api/validate \
-H "Content-Type: application/json" \
-H "WITGEN_API_KEY: test-api-key" \
-d '{"content": "package example:math; interface calculator { add: func(a: u32, b: u32) -> u32; }"}'
Validates a WIT file uploaded as form data.
curl -X POST https://witgen.dev/api/validate-file \
-H "WITGEN_API_KEY: test-api-key" \
-F "file=@path/to/your.wit"
For a more convenient integration, use our Rust client:
git clone https://github.com/username/wit-validator-api
cd wit-validator-api/test_client
cargo run -- --url https://witgen.dev --file path/to/your.wit
{
"valid": true,
"errors": [],
"warnings": [
"No world declaration found",
"Some statements may be missing semicolons"
]
}
The Wrangler.toml Validator API provides tools to validate Cloudflare Workers configuration files for syntax, structure, and best practices.
Health check endpoint to verify API status.
curl -X GET https://witgen.dev/api/wrangler/health
Validates wrangler.toml content provided in JSON format.
curl -X POST https://witgen.dev/api/wrangler/validate \
-H "Content-Type: application/json" \
-H "WITGEN_API_KEY: test-api-key" \
-d '{"content": "name = \"my-worker\"\nmain = \"build/worker/shim.mjs\"\ncompatibility_date = \"2025-03-31\""}'
Validates a wrangler.toml file uploaded as form data.
curl -X POST https://witgen.dev/api/wrangler/validate-file \
-H "WITGEN_API_KEY: test-api-key" \
-F "file=@path/to/your/wrangler.toml"
{
"valid": true,
"errors": [],
"warnings": [
"Missing 'build' section with 'command' field",
"Missing [[rules]] section for WebAssembly handling",
"No 'routes' or 'triggers' defined for this worker"
]
}
We're actively developing additional APIs for the WebAssembly component model ecosystem. Check back soon for updates!