没有没有。您可以在此处找到可用的数组验证:
https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.4.4
您可以指定一个数字必须是x的倍数:
https://json-schema.org/understanding-json-schema/reference/numeric.html#multiples但是,当然,这只能完成您想要实现的一部分。
它很简单。我定义了一个自定义验证器
Https://python-jsonschema.readthedocs.io/en/stable/creating/
。 不幸的是,我必须在验证器内进行验证,即该实例是数字的数组。