在等级库http://json-schema.org/latest/json-schema-core.html中,它仅列出以下类型: null、布尔值、字符串、数字、对象、数组。
我知道number包含整数,但我可以明确定义一个"type":" integer“吗?我的意思是这会违反规范吗?
发布于 2017-03-16 05:11:48
可以,您可以在模式中使用{"type": "integer"}。
{"type": "integer"}
请参见:
https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-04#section-3.5
https://datatracker.ietf.org/doc/html/draft-fge-json-schema-validation-00#section-5.5.2
https://stackoverflow.com/questions/42820558
相似问题