Asp.net Azure API应用程序,未返回模型状态错误

Asp.net Azure API应用程序,未返回模型状态错误,asp.net,asp.net-mvc,api,azure,azure-api-apps,Asp.net,Asp.net Mvc,Api,Azure,Azure Api Apps,我有一个ASP.net Web API,它使用Visual Studio 2015中的“Azure API应用程序预览”模板,我正在将该模板部署到Azure API应用程序 在我的应用程序中,我使用了,和文章中描述的一个操作过滤器来对所有传入的http请求调用ModelState.isValid,并在http 400响应中返回带有错误的模型状态 这一切在本地都能完美工作,事实上,当部署到Azure网站时,但当将相同的代码部署到Azure API应用程序时,请求似乎被重新包装在新的响应中(见下文,

我有一个ASP.net Web API,它使用Visual Studio 2015中的“Azure API应用程序预览”模板,我正在将该模板部署到Azure API应用程序

在我的应用程序中,我使用了,和文章中描述的一个操作过滤器来对所有传入的http请求调用
ModelState.isValid
,并在http 400响应中返回带有错误的模型状态

这一切在本地都能完美工作,事实上,当部署到Azure网站时,但当将相同的代码部署到Azure API应用程序时,请求似乎被重新包装在新的响应中(见下文,它似乎在向json添加状态和源字段),并且从请求中删除模型状态错误的结果

有没有办法强制API应用程序在重新包装的响应中包含这些内容,或者这确实是一个bug?没有潜在错误的400响应对任何API用户都没有多大用处

本地结果和Azure网站上的结果

HTTP/1.1 400 Bad Request
{
  "Message":"The request is invalid.",
  "Errors":
       {
         "InitialAmount":["The value 'a' is not valid for InitialAmount.",
                "The InitialAmount field is required."]
       }
}
结果Azure Api应用程序

HTTP/1.1 400 Bad Request
{
  "status": 400,
  "source": "https://MYAPIAPP.azurewebsites.net/api/Test?InitialAmount=a",
  "message": "The request is invalid."
}