【问题标题】:How to validate against a definition within a schema?如何验证模式中的定义?
【发布时间】:2014-11-21 11:26:29
【问题描述】:

我想要一个包含多个定义的架构文件。

然后我想根据该架构的不同定义验证消息。

有没有办法用 JSON Schema 做到这一点?

我正在尝试两个 NodeJS 验证器,看看哪个效果最好: https://github.com/geraintluff/tv4https://github.com/tdegrunt/jsonschema

抱歉,如果这在逻辑上不可行 - 我是 JSON Schema 的新手。

交叉发布到https://github.com/geraintluff/tv4/issues/170https://github.com/tdegrunt/jsonschema/issues/94

【问题讨论】:

    标签: json node.js jsonschema json-schema-validator


    【解决方案1】:

    我在 API 部分找到了我需要的东西。

    tv4.addSchema()tv4.getSchema(...#subschema_id')

    【讨论】:

      猜你喜欢
      • 2019-11-06
      • 1970-01-01
      • 2019-03-30
      • 2014-02-26
      • 1970-01-01
      • 1970-01-01
      • 2012-08-26
      • 2020-01-07
      • 2010-09-06
      相关资源
      最近更新 更多