InterfaceParam 接口参数
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface InterfaceParam {
"concept": "InterfaceParam", // 产品概念
"name": string, // 接口参数名称
"description": string, // 接口参数描述
"typeAnnotation": TypeAnnotation, // 类型
"in": "query" | "path" | "body" | "header" | "cookie", // in
"required": boolean, // 是否必填
"defaultValue": string, // 默认值
}
class InterfaceParamTreeNode {
ConceptEnum concept; // 产品概念
String name; // 接口参数名称
String description; // 接口参数描述
TypeAnnotationTreeNode typeAnnotation; // 类型
InEnum in; // in
boolean required; // 是否必填
String defaultValue; // 默认值
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/InterfaceParam",
"definitions": {
"InterfaceParam": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "InterfaceParam"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"in": {
"type": "string",
"enum": [
"query",
"path",
"body",
"header",
"cookie"
]
},
"required": {
"type": "boolean"
},
"defaultValue": {
"type": "string"
}
},
"required": [
"concept",
"name",
"description",
"typeAnnotation",
"in",
"required",
"defaultValue"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "InterfaceParam",
"name": "param1",
"description": "",
"typeAnnotation": null,
"in": "",
"required": true,
"defaultValue": null
}
concept: InterfaceParam
name: param1
description: ""
typeAnnotation: null
in: ""
required: true
defaultValue: null