Interface 接口
1. 结构声明
- TS Declaration
- JSON Schema
class Interface extends ImportedInterface {
name: string = '';
title: string;
originLogicName?: string;
path: string;
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
description?: string;
params: Array<InterfaceParam>;
returns: Array<Return>;
validation?: BindAttribute;
protocol?: 'HTTP' | 'HTTPS' | 'DUBBO';
protocolParams: Array<Param>;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"changedTime": {
"$ref": "#/definitions/long"
},
"exampleMap": {
"type": "object",
"properties": {
"size": {
"type": "number"
}
},
"required": [
"size"
],
"additionalProperties": false
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"originLogicName": {
"type": "string"
},
"path": {
"type": "string"
},
"method": {
"type": "string",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH"
]
},
"description": {
"type": "string"
},
"params": {
"type": "array",
"items": {
"$ref": "#/definitions/InterfaceParam"
}
},
"returns": {
"type": "array",
"items": {
"$ref": "#/definitions/Return"
}
},
"validation": {
"$ref": "#/definitions/BindAttribute"
},
"protocol": {
"type": "string",
"enum": [
"HTTP",
"HTTPS",
"DUBBO"
]
},
"protocolParams": {
"type": "array",
"items": {
"$ref": "#/definitions/Param"
}
}
},
"required": [
"exampleMap",
"method",
"name",
"params",
"path",
"protocolParams",
"returns",
"title"
],
"additionalProperties": false
}