I have a large model which I am using for both GET and PUT on a resource. The model includes an "audit" object like so:
"audit": {
"createdAt": "2014-04-14T02:15:15Z",
"lastUpdatedAt": "2014-04-14T02:15:15Z",
"deletedAt": ""
}
This is obviously a readonly part of the resource - is there any way to show this in the contract model so "audit" appears for the GET response representation but not the PUT request representation?
The only alternative I can see is to copy the model into the body of the PUT and remove the readonly parts - but that then eliminates the benefit of having a single model that is reusable across different methods.