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