我正在尝试使用 apiary(apiblueprint)创建我的 api,但是当我将发布数据发送到我的端点时,我总是得到 201 响应。但是端点需要一些参数,所以当我发送空帖子时,我应该收到一些错误消息。我该怎么做?
### Create a New Question [POST]
+ question `Some text message` (string, required)
+ Request (application/json)
{
"question": "Favourite programming language?",
"choices": [
"Swift",
"Python",
"Objective-C",
"Ruby"
]
}
+ Response 201 (application/json)
+ Headers
Location: /questions/2
+ Body
{
"question": "Faavourite programming language?",
"published_at": "2015-08-05T08:40:51.620Z",
"choices": [
{
"choice": "Swift",
"votes": 0
}, {
"choice": "Python",
"votes": 0
}, {
"choice": "Objective-C",
"votes": 10
}, {
"choice": "Ruby",
"votes": 0
}
]
}