SwitchCase 选择分支情况
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface SwitchCase {
"concept": "SwitchCase", // 产品概念
"test": LogicItem, // 条件表达式
"consequent": Array<LogicItem>, // then
}
class SwitchCaseTreeNode {
ConceptEnum concept; // 产品概念
LogicItemTreeNode test; // 条件表达式
List<LogicItemTreeNode> consequent; // then
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/SwitchCase",
"definitions": {
"SwitchCase": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "SwitchCase"
},
"test": {
"$ref": "#/definitions/LogicItem"
},
"consequent": {
"type": "array",
"items": {
"$ref": "#/definitions/LogicItem"
}
}
},
"required": [
"concept",
"test",
"consequent"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "SwitchCase",
"test": null,
"consequent": []
}
concept: SwitchCase
test: null
consequent: []