.json 文件架构验证的最佳工具

Best tool for .json file schema validation

可能有很多 tools/libraries 来验证 JSON 模式。 我有一个图书馆,并希望我的图书馆的用户拥有符合预期 API 的配置文件。

使用 Webstorm,IDE 会告诉我我的 Webpack 配置文件架构不正确,如下所示:

负责的Webpack文件在这里:

https://github.com/webpack/webpack/blob/master/schemas/webpackOptionsSchema.json

与 Webstorm、VSCode、Atom、ST3 等现有 IDE 的集成将是一个巨大的优势。

我还没弄清楚如何正确执行此操作...有人知道吗?

要与各种 IDE 集成,请考虑将您的 json 架构上传到 JSON Schema Store

这是 GitHub 回购 https://github.com/SchemaStore/schemastore

这包含许多众所周知的 json 文件的 json 模式,并且很容易与 Visual Studio 和 VS Code 集成。

另请查看 Visual Studio 的分步集成步骤 https://scottaddie.com/2016/08/02/community-driven-json-schemas-in-visual-studio-2015/