StructureProperty 数据结构属性
1. 结构声明
- TS Declaration
- JSON Schema
class StructureProperty extends BaseNode {
name: string = '';
label?: string;
description?: string;
typeAnnotation?: TypeAnnotation;
required: boolean;
defaultValue?: string;
jsonName?: string;
}
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"required": {
"type": "boolean"
},
"defaultValue": {
"type": "string"
},
"jsonName": {
"type": "string"
}
},
"required": [
"name",
"required"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "StructureProperty",
"name": "count",
"label": "数量",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
},
"description": "",
"required": false,
"defaultValue": "",
"jsonName": ""
}
concept: StructureProperty
name: count
label: 数量
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Long
inferred: false
ruleMap: {}
description: ""
required: false
defaultValue: ""
jsonName: ""
(2) 示例
AST 如下:
- JSON
- YAML
{
"concept": "StructureProperty",
"name": "count",
"label": "数量",
"description": "订单中该商品的数量",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
},
"jsonName": "count-",
"required": false,
"defaultValue": "120"
}
concept: StructureProperty
name: count
label: 数量
description: 订单中该商品的数量
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Long
inferred: false
ruleMap: {}
jsonName: count-
required: false
defaultValue: "120"