问题描述
请说明为何此json不针对架构给出验证错误:
架构
File "test.py",line 34,in <module>
drv(t=Uint[16],seq=[0,1,2,3]) | add() | collect(result=result)
GearArgsNotSpecified: [0],Unresolved argument "[]" connected to the input "result"
- when instantiating "collect"
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#","type": "object","properites": {
"address": {
"type": "array","items":{
"type": "object","properties": {
"ip": {
"type": "string"
},"port": {
"type": "integer"
},"interface": {
"type": "string"
},"maskLength": {
"type": "integer"
}
},"required": [
"ip","port","interface","maskLength"
]
}
}
},"required": [
"address"
]
}
我正在https://www.jsonschemavalidator.net/上对此进行测试,它使验证成功,这是我所不了解的。根据架构,界面和 maskLength 是必填字段,某些数组元素中缺少这些字段。另外,“ ip”的类型在架构中是字符串,但在json中,整数类型也被接受。为什么不拒绝此json?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)