简体   繁体   English

JSON 模式验证与 Java API

[英]JSON schema validation with Java API

I am not interested in validating JSON documents against JSON schema.我对根据 JSON 架构验证 JSON 文档不感兴趣。 I would like to validate JSON schema itself, check whether it is valid against a specific draft.我想验证 JSON 模式本身,检查它是否对特定草案有效。 Are there tools Java that would validate schema itself?是否有工具 Java 可以验证架构本身?

A JSON Schema (in JSON format) is nothing else but another JSON document. JSON 模式(JSON 格式)只不过是另一个 JSON 文档。
What you're describing is exactly what Meta Schemas are for.您所描述的正是元模式的用途。

That means any library for validating JSON documents against a JSON Schema can be used to validate a JSON Schema against a respective Draft's Meta Schema.这意味着任何用于根据 JSON Schema 验证 JSON 文档的库都可以用于针对相应的 Draft 元 Schema 验证 JSON Schema。 Examples for available Java libraries are listed on json-schema.org/implementations.html json-schema.org/implementations.html 上列出了可用Java库的示例

Meta Schemas are published alongside the specification on json-schema.org元模式与json-schema.org上的规范一起发布

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM