复杂的schema
重用
重用此架构,因此习惯上(但不是必需)将其放在父架构下的 :definitions
{ "definitions": { "address": { "type": "object", "properties": { "street_address": { "type": "string" }, "city": { "type": "string" }, "state": { "type": "string" } }, "required": ["street_address", "city", "state"] } } }
{ "$ref": "#/definitions/address" }
- 转到文档的根目录
- 找到钥匙的价值 "definitions"
- 在该对象中,找到键的值 "address"