I have resource Student and 4 API endpoints:
POST: /students
GET: /students/{id}
PUT: /students/{id}
DELETE: /students/{id}
Now, I want to add new property Address as an object to Student:
class Student
{
public int Id;
public string Name;
public Address Address;
}
Address has property Street as an object too.
My question is, if I want to update only the address or street, would it be better to:
- Use update student API: provide all student properties even if they are not changed
- Create new endpoints
PUT: /students/{id}/addressandPUT: /students/{id}/address/street