ParamWithGroup 带分组的参数
1. 结构声明
- TS Declaration
- JSON Schema
class ParamWithGroup extends Param {
title: string;
group!: string;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"changedTime": {
"$ref": "#/definitions/long"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"spread": {
"type": "boolean"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"defaultValue": {
"$ref": "#/definitions/DefaultValue"
},
"title": {
"type": "string"
},
"group": {
"type": "string"
}
},
"required": [
"group",
"name",
"title"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "ParamWithGroup",
"name": "size",
"title": "大小",
"group": "分组1",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
}
}
concept: ParamWithGroup
name: size
title: 大小
group: 分组1
description: ""
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Long
inferred: false
ruleMap: {}
对应的代码如下:
- 文本化 NASL
- Natural TS
@(
title = "大小",
group = "分组1",
)
size: Integer
size: Long