OpenAI and Anthropic structured-output APIs accept only a strict subset of JSON Schema. Ship a schema with an unsupported keyword, a missing required entry, or the wrong additionalProperties, and the API rejects it — in production, at request time, as a 400.
schemalint catches those errors at build time, checked against the exact provider rules, so a bad schema fails your CI instead of your users' requests.
Install
# npm / bun — adds the `schemalint` command to your project
# Rust
# Python
Quick start
Check a schema against OpenAI's structured-output rules:
error[OAI-K-allOf]: keyword 'allOf' is not supported by openai.so.2026-04-30
--> schema.json
1 issue found (1 error, 0 warnings) across 1 schema
Check a whole directory, for both providers at once:
Lint Zod and Pydantic directly
Schemas live in your code, not in .json files? schemalint reads them straight from your Zod or Pydantic definitions — no manual JSON Schema export, no second package to install.
// package.json
{
"scripts": { "lint:schemas": "schemalint check-node" },
"schemalint": {
"profiles": ["openai.so.2026-04-30"],
"include": ["src/**/*.ts"]
}
}
What it catches
- Unsupported keywords (
allOf,oneOf,not, unsupportedformats, …) per provider - Missing
requiredentries andadditionalProperties: falsemistakes - Invalid root shapes, unsupported
$refpatterns, and enum / nesting limits - Size and depth limits that otherwise only surface as a runtime
400
Providers
| Provider | Profile |
|---|---|
| OpenAI Structured Outputs | openai.so.2026-04-30 |
| Anthropic Structured Outputs | anthropic.so.2026-04-30 |
In CI
schemalint exits non-zero on errors, so it fails the build before a broken schema ever ships:
- run: npx schemalint check --profile openai.so.2026-04-30 schemas/
Pick the output format that fits your pipeline:
| Exit code | Meaning |
|---|---|
0 |
No errors |
1 |
Schema, parse, or read errors |
2 |
Could not write the output file |
Documentation
Contributing
Bug reports, new rules, and provider profiles are all welcome — see CONTRIBUTING.md and CODE_OF_CONDUCT.md.
Security
Found a vulnerability? Please report it privately — see SECURITY.md.
License
Dual-licensed under MIT or Apache-2.0, at your option.