【发布时间】:2020-05-12 05:43:50
【问题描述】:
我有一个帐户列表(accountId、currency、accountType)
Id1 ,美元,账户 / Id2、英镑、账户/ Id3 , 欧元, 账户 / Id4、NOK、账户
当我调用 api 以获取帐户列表时,我想确保 accountid = 3 不在结果中。我怎样才能做到这一点?这是我的架构:
{
"title": "Acc schema",
"type": "object",
"definitions": {
"account": {
"properties": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 15
},
"currency": {
"type": "string",
"minLength": 3,
"maxLength": 3
},
"accountType": {
"type": "string",
"enum": [
”Account”
]
}
},
"required": ["accountId"],
"additionalProperties": false
},
"data": {
"type": "object",
"properties": {
"accounts": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/definitions/account"
}
],
"additionalItems": false
}
},
"additionalProperties": false
}
}
},
"properties": {
"data": {
"$ref": "#/definitions/data"
},
"headers": {
"type": "object"
},
"config": {
"type": "object"
},
"request": {
"type": "object"
},
"status": {
"type": "number"
},
"statusText": {
"type": "string"
}
},
"additionalProperties": false
}
【问题讨论】:
标签: arrays jsonschema