【发布时间】:2020-08-08 19:30:47
【问题描述】:
我想验证温度和寒冷系数,其值低于零,但我不确定是否使用最小值:-10,例如 -20 是否正确使用。
对于温度、寒冷系数和风速的实际最大值也是如此。
什么是正确使用?
非常感谢。
JsonSchema 如下:
"type": "object",
"properties": {
"weather": {
"type": "array",
"items": {
"type": "object",
"properties": {
"windSpeed": {
"type": "number",
"minimum": 0.00
},
"cityName": {
"type": "string"
},
"currentConditions": {
"type": "string",
"enum": [ "Cloud", "Snow", "Sun", "Hail", "Rain", "Sleet", "Heavy Rain"]
},
"temperature": {
"type": "number",
"minimum": 0.00
},
"windDirection": {
"type": "string",
"enum": ["Northerly", "North easterly", "Easterly", "South easterly", "Southerly", "South westerly", "Westerly", "North westerly"]
},
"windChillFactor": {
"type": "number",
"minimum": 0.00
}
},
"required": ["cityId", "cityName", "currentConditions", "temperature", "windSpeed", "windDirection", "windChillFactor"]
}
}
}
}
【问题讨论】:
标签: json jsonschema weather weather-api json-schema-validator