简体   繁体   English

JSON Schema 来验证 JSON Schema

[英]JSON Schema to validate a JSON Schema

We are using JSON Schema to validate the editing of some business objects, and the Schema itself is editable (it rarely changes but we wanted to allow admins to amend via the product itself).我们正在使用 JSON Schema 来验证某些业务对象的编辑,并且 Schema 本身是可编辑的(它很少更改,但我们希望允许管理员通过产品本身进行修改)。

Validating the amendments of business objects via the schema itself is working well, but we want to ensure that any edits to the schema itself adhere to JSON Schema rules, is there a JSON schema to validate that a certain JSON is in fact a valid JSON Schema?通过模式本身验证业务对象的修改运行良好,但我们要确保对模式本身的任何编辑都遵守 JSON 模式规则,是否有 JSON 模式来验证某个 JSON 实际上是有效的 JSON 模式? I know it might sound like a philosophical question, but it is something we would love to have if possible!我知道这听起来像是一个哲学问题,但如果可能的话,这是我们希望拥有的东西!

The schema for the schema is called the "meta-schema" and is identified by the $schema keyword in your schema.模式的模式称为“元模式”,由模式中的$schema关键字标识。 The Draft 2020-12 meta-schema can be found here .可以在此处找到 2020-12 元模式草案。

Implementations should be able to validate a schema using its meta-schema for you.实现应该能够为您使用其元模式来验证模式。

You can learn more at https://json-schema.org/specification.html .您可以在https://json-schema.org/specification.html了解更多信息。

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

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