Function 函数
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface Function {
"concept": "Function", // 产品概念
"name": string, // 函数名称
"description": string, // 函数描述
"typeParams": Array<TypeParam>, // 类型参数列表
"params": Array<Param>, // 输入参数列表
"returns": Array<Return>, // 输出参数列表
"variables": Array<Variable>, // 变量列表
"returnExpression": LogicItem, // 逻辑项
}
class FunctionTreeNode {
ConceptEnum concept; // 产品概念
String name; // 函数名称
String description; // 函数描述
List<TypeParamTreeNode> typeParams; // 类型参数列表
List<ParamTreeNode> params; // 输入参数列表
List<ReturnTreeNode> returns; // 输出参数列表
List<VariableTreeNode> variables; // 变量列表
LogicItemTreeNode returnExpression; // 逻辑项
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/Function",
"definitions": {
"Function": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "Function"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"typeParams": {
"type": "array",
"items": {
"$ref": "#/definitions/TypeParam"
}
},
"params": {
"type": "array",
"items": {
"$ref": "#/definitions/Param"
}
},
"returns": {
"type": "array",
"items": {
"$ref": "#/definitions/Return"
}
},
"variables": {
"type": "array",
"items": {
"$ref": "#/definitions/Variable"
}
},
"returnExpression": {
"$ref": "#/definitions/LogicItem"
}
},
"required": [
"concept",
"name",
"description",
"typeParams",
"params",
"returns",
"variables",
"returnExpression"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "Function",
"name": "String",
"description": "String",
"typeParams": [],
"params": [],
"returns": [],
"variables": [],
"returnExpression": null
}
concept: Function
name: String
description: String
typeParams: []
params: []
returns: []
variables: []
returnExpression: null