如何创建一个整数,json-schema,验证整数不等于 0(零)的验证规则?
How to create an integer, json-schema, validation rule that validates an integer is not equal to 0(zero)?
我想验证一个整数值 (属性) 是否为 0(零)。
允许正整数和负整数,但 0 除外。
您可以使用 not
enum
: {"type":"integer", "not":{"enum":[0]}}
.
或 not
const
最近 JSON 架构修订:{"type":"integer", "not":{"const":0}}
我想验证一个整数值 (属性) 是否为 0(零)。 允许正整数和负整数,但 0 除外。
您可以使用 not
enum
: {"type":"integer", "not":{"enum":[0]}}
.
或 not
const
最近 JSON 架构修订:{"type":"integer", "not":{"const":0}}