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

Commented Issue: application/json should return json verbose when MaxDataServiceVersion is 2.0 [830]

$
0
0
We should return json verbose payload when old client requests for json. This is the same behavior as WCF DS.

Currently, we always returns json light payload and fails when MaxODataServiceVersion is lower than 3.0.
Comments: The OData lib does not like the DataServiceVersion = 2.0 as it does not support the fullmetadata with 2.0. Here is the exception message + $exception "A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) 'application/atom+xml;type=feed, application/atom+xml, application/json;odata=verbose, application/json' do not match any of the acceptable MIME types 'application/json; odata=fullmetadata; charset=utf-8'." System.Exception {Microsoft.Data.OData.ODataContentTypeException} Here is the stack > System.Web.Http.OData.dll!System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObject(object graph, Microsoft.Data.OData.ODataMessageWriter messageWriter, System.Web.Http.OData.Formatter.Serialization.ODataSerializerContext writeContext) Line 61 + 0x11 bytes C# System.Web.Http.OData.dll!System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync.AnonymousMethod__9() Line 425 + 0x2f bytes C# System.Web.Http.OData.dll!System.Threading.Tasks.TaskHelpers.RunSynchronously(System.Action action, System.Threading.CancellationToken token) Line 208 C# System.Web.Http.OData.dll!System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync(System.Type type, object value, System.IO.Stream writeStream, System.Net.Http.HttpContent content, System.Net.TransportContext transportContext) Line 339 + 0x33 bytes C# System.Net.Http.Formatting.dll!System.Net.Http.ObjectContent.SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) Line 112 + 0x3a bytes C# System.Net.Http.dll!System.Net.Http.HttpContent.CopyToAsync(System.IO.Stream stream, System.Net.TransportContext context) Line 223 + 0xf bytes C# System.Net.Http.dll!System.Net.Http.HttpContent.CopyToAsync(System.IO.Stream stream) Line 259 + 0x7 bytes C# System.Web.Http.SelfHost.dll!System.Web.Http.SelfHost.Channels.HttpMessageEncoderFactory.HttpMessageEncoder.WriteMessage(System.ServiceModel.Channels.Message message, System.IO.Stream stream) + 0x13b bytes System.Web.Http.SelfHost.dll!System.Web.Http.SelfHost.Channels.HttpMessageEncoderFactory.HttpMessageEncoder.WriteMessage(System.ServiceModel.Channels.Message message, int maxMessageSize, System.ServiceModel.Channels.BufferManager bufferManager, int messageOffset) + 0x266 bytes

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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