Affects Version/s: V4.0_ERRATA02
Fix Version/s: V4.0_ERRATA03
The question came up recently as to whether the @odata.type attribute is required when updating a type derived from the type specified for a collection.
Currently in the protocol spec we say: "The service ignores entity id and entity type values in the payload when applying the update."
This was added to clarify that:
1) Clients couldn't change the type of an existing entity, and that
2) Services weren't required to validate that the type specified in the update was the same as the actual type of the object; it could just apply the values and returned an error if any properties were invalid.
HOWEVER, in the JSON format specification we say that:
"The odata.type annotation MUST appear in requests and in responses with minimal or full metadata, if the type cannot be heuristically determined, as described below, and one of the following is true:
• The type is derived from the type specified for the (collection of) entities or (collection of) complex type instances, or
• The type is for a property whose type is not declared in $metadata."
And, in fact, some frameworks may require the type annotation in order to materialize an object of the correct type from the payload from which to apply the update.
Either way, we should clarify the documents to be consistent.