Closed machinly closed 2 years ago
Lark Open Platform does return this. I think we'd better respect to its field name.
BaseResponse will return in bad response. Success Request:
curl -X POST -H "Content-Type: application/json" \
-d '{"msg_type":"interactive","card":{"config":{"wide_screen_mode":true},"elements":[]}}' \
https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx
Success Response:
{
"Extra":null,
"StatusCode":0,
"StatusMessage":"success"
}
Bad Request (without elements):
curl -X POST -H "Content-Type: application/json" \
-d '{"msg_type":"interactive","card":{"config":{"wide_screen_mode":true}}}' \
https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx
Bad Resonse:
{
"code": 11246,
"data": {},
"msg": "msg: elements/i18n_elements should not be empty, code: 100000"
}
BaseResponse will return in bad response. Success Request:
curl -X POST -H "Content-Type: application/json" \ -d '{"msg_type":"interactive","card":{"config":{"wide_screen_mode":true},"elements":[]}}' \ https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx
Success Response:
{ "Extra":null, "StatusCode":0, "StatusMessage":"success" }
Bad Request (without elements):
curl -X POST -H "Content-Type: application/json" \ -d '{"msg_type":"interactive","card":{"config":{"wide_screen_mode":true}}}' \ https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx
Bad Resonse:
{ "code": 11246, "data": {}, "msg": "msg: elements/i18n_elements should not be empty, code: 100000" }
Okay, this is weird. So we can basically add BaseResponse
and it works, but with weird behavior.
Though notifications seldom get error in return, I think it is necessary to add BaseResponse
for that.
Thanks for fixing this.
Struct PostNotificationV2Resp dose not has BaseResponse. This hides some error information, which may confuse users.