StructureProperty 数据结构属性
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface StructureProperty {
"concept": "StructureProperty", // 产品概念
"name": string, // 数据结构属性名称
"label": string, // 数据结构属性标题
"description": string, // 数据结构属性描述
"typeAnnotation": TypeAnnotation, // 类型
"required": boolean, // 是否必填
"defaultValue": string, // 默认值,JSON 字符串
"jsonName": string, // 数据结构字段 JSON 的序列化别名,JSON 字符串别名
}
class StructurePropertyTreeNode {
ConceptEnum concept; // 产品概念
String name; // 数据结构属性名称
String label; // 数据结构属性标题
String description; // 数据结构属性描述
TypeAnnotationTreeNode typeAnnotation; // 类型
boolean required; // 是否必填
String defaultValue; // 默认值,JSON 字符串
String jsonName; // 数据结构字段 JSON 的序列化别名,JSON 字符串别名
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/StructureProperty",
"definitions": {
"StructureProperty": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "StructureProperty"
},
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"required": {
"type": "boolean"
},
"defaultValue": {
"type": "string"
},
"jsonName": {
"type": "string"
}
},
"required": [
"concept",
"name",
"label",
"description",
"typeAnnotation",
"required",
"defaultValue",
"jsonName"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "StructureProperty",
"name": "age",
"label": "年龄",
"description": "年龄描述",
"typeAnnotation": null,
"required": true,
"defaultValue": null,
"jsonName": null
}
concept: StructureProperty
name: age
label: 年龄
description: 年龄描述
typeAnnotation: null
required: true
defaultValue: null
jsonName: null
详细参考Structure 数据结构-示例。