{
"name": "George Washington",
"birthday": "February 22, 1732",
"address": "Mount Vernon, Virginia, United States"
}
object
;name
、birthday
、address
这三个字段name
、address
的字段值是一个字符串 String
,birthday
的值是一个日期。 {
"type": "object",
"properties": {
"name": { "type": "string" },
"birthday": { "type": "string", "format": "date" },
"address": { "type": "string" }
}
}
{
"type": "object",
"properties": {
"first_name": { "type": "string" },
"last_name": { "type": "string" },
"birthday": { "type": "string", "format": "date-time" },
"address": {
"type": "object",
"properties": {
"street_address": { "type": "string" },
"city": { "type": "string" },
"state": { "type": "string" },
"country": { "type" : "string" }
}
}
}
}
{}
exclusiveMaximum
为 true
表示不包含边界值 maximum
,类似的还有 exclusiveMinimum
字段.
direction
,而 schema 规定了不允许额外的字段 "additionalProperties": false