I have a 'persons' collection in mongodb that contains the following objects (modelled in c#):
public class Person {
public String firstName;
public String lastName;
public List<Address> addresses;
}
I have a REST API that exposes various endpoints for CRUD operations on 'person' resources. If I have an endpoint that allows you to update the firstName of a person, the HTTP method would be PATCH. My tech lead agrees with this. But when it comes to an endpoint that adds an address to a person's list of addresses, my tech lead says it should be POST because we are creating a new address. I don't agree because we are updating a person resource, just like updating the firstName. Adding an address is still updating a person resource. So who is correct? PATCH or POST or does it even matter?