Rect 矩形信息
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface Rect {
"concept": "Rect", // 产品概念
"x": number, // x
"y": number, // y
"width": number, // width
"height": number, // height
}
class RectTreeNode {
ConceptEnum concept; // 产品概念
double x; // x
double y; // y
double width; // width
double height; // height
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/Rect",
"definitions": {
"Rect": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "Rect"
},
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"width": {
"type": "number"
},
"height": {
"type": "number"
}
},
"required": [
"concept",
"x",
"y",
"width",
"height"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "Rect",
"x": 2.5,
"y": 3,
"width": 40,
"height": 30
}
concept: Rect
x: 2.5
y: 3
width: 40
height: 30