Here's a simple scenario:
We have a list of tasks and can mark a task as completed by invoking a web service. Doing so will transition the
status of the task to
completed as well as initialize a
completedOn data member.
Is it a good practice for services to return additional data members required for the UI to sync the client data state? To me, it feels a bit weird that the
markTaskCompleted service or
PUT /tasks/completed/ ... returns a
completedOn data member in the response.
What's the preferred way of dealing with similar situations in the industry? Is there a widely adopted practice?
In the above case, I could probably just infer the
completedOn value client-side, but that's not always possible.