ValidationRule 验证规则
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface ValidationRule {
"concept": "ValidationRule", // 产品概念
"label": string, // 验证规则标题
"calleeNamespace": string, // calleeNamespace
"calleeName": string, // calleeName
"arguments": Array<Argument>, // 实际参数
"errorMessage": LogicItem, // 错误信息
"target": LogicItem, // 验证对象
"enableServerValidation": boolean, // 是否启用服务端验证
}
class ValidationRuleTreeNode {
ConceptEnum concept; // 产品概念
String label; // 验证规则标题
String calleeNamespace; // calleeNamespace
String calleeName; // calleeName
List<ArgumentTreeNode> arguments; // 实际参数
LogicItemTreeNode errorMessage; // 错误信息
LogicItemTreeNode target; // 验证对象
boolean enableServerValidation; // 是否启用服务端验证
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/ValidationRule",
"definitions": {
"ValidationRule": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "ValidationRule"
},
"label": {
"type": "string"
},
"calleeNamespace": {
"type": "string"
},
"calleeName": {
"type": "string"
},
"arguments": {
"type": "array",
"items": {
"$ref": "#/definitions/Argument"
}
},
"errorMessage": {
"$ref": "#/definitions/LogicItem"
},
"target": {
"$ref": "#/definitions/LogicItem"
},
"enableServerValidation": {
"type": "boolean"
}
},
"required": [
"concept",
"label",
"calleeNamespace",
"calleeName",
"arguments",
"errorMessage",
"target",
"enableServerValidation"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "ValidationRule",
"label": "验证规则",
"calleeNamespace": null,
"calleeName": null,
"arguments": [],
"errorMessage": null,
"target": null,
"enableServerValidation": true
}
concept: ValidationRule
label: 验证规则
calleeNamespace: null
calleeName: null
arguments: []
errorMessage: null
target: null
enableServerValidation: true