Assuming you have the following object:
public class Person {
public string Name { get; set; }
public string Surname { get; set; }
public int Age { get; set; }
}
and got a PATCH request as below:
[{"replace": "/name", "value": "tugberk"}]
and assuming we have a json-patch formatter. Wouldn't you get the following result?
public class PeopleController : ApiController {
//new Person { Name = "tugberk", Surname = null, Age = 0 }
public Person PatchPerson(Person person) {
//...
}
}
No, the controller should have a Patch operation that accepts a command implementing a common base class / interface e.g. IPatchCommand. This is what you would work with in the media type formatter (like I do with IPublicationCommand in AtomPub).