Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: EnableOData will convert HttpError to ODataError even it's not from odata service [672]

$
0
0
By EnableOData in an existing web api project, all the HttpError in the project will be converted to ODataError when client requests application/json or application/xml.<br /><br />The error payload's shape will be changed:<br />Before enable odata:<br />{"Message":"No HTTP resource was found that matches the request URI 'http://localhost:8081/api/Value'.","MessageDetail":"No type was found that matches the controller named 'Value'."}<br /><br />After enable odata:<br />{<br /> "odata.error":{<br /> "code":"","message":{<br /> "lang":"en-US","value":"No HTTP resource was found that matches the request URI 'http://localhost:8081/api/Value'."<br /> }<br /> }<br />}<br /><br />A workaround is to insert JsonMediaTypeFormatter on top of formatters after EnableOData. But it will stop json light working for any application/json request.
Comments: We will revisit this feature in vNext.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>