Param 输入参数
1. 结构声明
- TS Declaration
- JSON Schema
class Param extends BaseNode {
name: string = '';
description: string;
typeAnnotation?: TypeAnnotation;
required: boolean;
defaultValue?: string;
}
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"required": {
"type": "boolean"
},
"defaultValue": {
"type": "string"
}
},
"required": [
"name",
"description",
"required"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "Param",
"name": "filter",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Date",
"inferred": false,
"ruleMap": {}
},
"required": true
}
concept: Param
name: filter
description: ""
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Date
inferred: false
ruleMap: {}
required: true
(2) 无类型标注的参数
AST 如下:
- JSON
- YAML
{
"concept": "Param",
"name": "index",
"description": "",
"required": true
}
concept: Param
name: index
description: ""
required: true