我想根据另一个字段在一个字段上设置最低金额。
例如,如果我有一个quoteAmountLower
and quoteAmountUpper
- 我想quoteAmountUpper
大于quoteAmountLower
。
如果下限为 50,则上限必须大于 50。
properties: {
quotedAmountLower: {
type: 'integer',
minimum: 0
},
quotedAmountUpper: {
type: 'integer',
// more than quotedAmountLower
minimum: 0
}
}
干杯
我尝试过使用引用或 $idquotedAmountLower
标准 JSON Schema 规范中没有可以引用实例中的值的关键字。
有一些建议,例如https://docs.json-everything.net/schema/vocabs/data-2023/(相关: https: //github.com/json-schema-org/json-schema-spec/issues /51),因此您可能需要自定义您正在使用的 JSON Schema 库或检查它是否支持类似的内容。