I retrieved an object via an OData WebAPI service using the DataSource, where the response looks like this:
My schema's model does not have "odata.metadata", and I don't want it included. The reason this extra property is a problem is that when I do an update, it sends "odata.metadata" as an item back on the OData POST request, and my WebAPI throws an error when trying to automatically map that, so I'd rather it just not send it at all. Right now, I'm manually deleting the property in the parse function to remove it, but it just feels wrong. It seems like the DataSource should not create an object with properties from my response that do not exist in the schema's model, so maybe I'm missing something here. Is the only way to handle this by manually doing something in the parse function?
{"odata.metadata":"http://localhost:49639/api/$metadata#Address/@Element","AddressKey":"1","AddressLine1":"test2","AddressLine2":"Suite 2004","City":"Lawrenceville","State":"Georgia","PostalCode":"30043"}
parse: function(response) {
// This property causes an issue when sending the model back, so removing it.
delete response["odata.metadata"];
},