Skip to content

Instantly share code, notes, and snippets.

@otakustay
Last active November 16, 2015 09:20
Show Gist options
  • Save otakustay/b5c553143c37b8eb42d5 to your computer and use it in GitHub Desktop.
Save otakustay/b5c553143c37b8eb42d5 to your computer and use it in GitHub Desktop.
interface declaration
"requestSchema": {
"protocol": "http",
"args": {
"pageSize": {
"type": "number",
"description": "页码",
"requried": false,
"defaultValue": 1
},
"keyword": {
"type": "string",
"description": "搜索的关键字",
"required": true,
"maxLength": 100
}
}
},
"responseSchema": {
"success": {
"statusCode": 200,
"body": {
"type": "object",
"structure": {
"totalCount": {
"type": "number",
"description": "总数",
"optional": false
},
"results": {
"type": "array",
"description": "结果集",
"item": {
"type": "object",
"structure": {
"id": {"type": "number"},
"name": {"type": "string", "description": "计划名称"}
}
}
}
}
}
},
"conflict": {
"status": 409,
"body": {
"type": "object",
"structure": {
"message": {
"type": "string",
"description": "全局错误信息"
},
"fields": {
"type": "array",
"item": {
"type": "object",
"structure": {
"name": {"type": "string", "description": "字段名"},
"message": {"type": "string", "description": "错误信息"}
}
}
}
}
}
}
},
"mockupData": {
"totalCount": 203,
"results": [
{},
{},
{},
{},
{},
{}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment