Redundant type name serialization in OData JSON light minimal metadata mode


When we write the entries for GET http://localhost:50231/Pets/SampleService.Model.BigPet , in JSON light minimal metadata mode, we emit type names for all BigPets. This is redundant as the type of the URI (BigPet) is the same as the type of entry being serialized. We should only emit type names if the entry being written is a derived type of BigPet.

This is happening as we compare the element type of the entity set (in this case, Pet) with the type of the entry being written (in this case, BigPet) and put the type name if they differ. Ideally, we should be checking the type of the uri and not the entity set.

The offending code is in ODataEntityTypeSerializer.cs , method - ShouldSuppressTypeNameSerialization.
Closed Oct 11, 2013 at 9:35 PM by jacalvar


raghuramn wrote Oct 9, 2013 at 5:02 PM