typescript-json-schema icon indicating copy to clipboard operation
typescript-json-schema copied to clipboard

Add Support for JSON Schema Linting Best Practices via `jsonschema` CLI

Open Karan-Palan opened this issue 5 months ago • 2 comments

ref https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1417#pullrequestreview-3198110654

Hello maintainers,

I recently created a pull request in modelcontextprotocol. The PR focused on fixing linting issues using the jsonschema cli's auto-fixing command (jsonschema lint --fix).

For context, I, along with @jviotti (JSON Schema TSC member) are defining linting rules for JSON Schema as a Part of a GSoC (Google Summer of code) project here - https://summerofcode.withgoogle.com/programs/2025/projects/PjLfP7ZH, and implementing their auto-fixes here - https://github.com/sourcemeta/jsonschema/blob/main/docs/lint.markdown. We have recently added many rules prefixing unknown keywords with x- which will be introduced in the newer JSON Schema drafts.

Would it be possible to integrate these best practices into this project so that all the projects using it get the schemas with all best practices applied to them?

It would be great as other projects that use this package won't have to add the jsonschema cli as a dependency (https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1417#pullrequestreview-3198110654)

I could help with:

  1. Add an option to automatically apply these fixes during schema generation.
  2. Alternatively, provide a hook or configuration to run the jsonschema lint --fix command as part of the generation process or integrate it in the CI

Karan-Palan avatar Sep 11 '25 13:09 Karan-Palan

I don't actively add features to this package but can merge PRs.

domoritz avatar Sep 11 '25 14:09 domoritz

@domoritz created a PR that integrates the cli -> https://github.com/YousefED/typescript-json-schema/pull/625

Karan-Palan avatar Sep 22 '25 06:09 Karan-Palan