Full replacement updates an entire resource field or representation instead of changing selected items. It is necessary when list positions are unstable: an administrator added or removed from a repeated field can shift indexes, making an index-based update ambiguous. section 8.3.3
For dynamic maps, full replacement can remove a key by retrieving the resource, deleting the key, and replacing the whole map field. Freshness checks can protect consistency, but replacing an entire dynamic resource becomes more complicated. section 8.3.6
Replacing a repeated administrator list
A ChatRoom with an administrators list should receive the complete intended list when administrator data changes. Avoid PATCH requests that assign names to Index 0 or Index 1, because list order is not guaranteed. For dynamic settings, PATCH with an explicit field mask and an omitted value is preferred when removing only one key; full replacement is the broader fallback. section 8.3.3 section 8.3.6
Listing 8.5 Representation of a ChatRoom with multiple administrators
interface ChatRoom {
id: string;
title: string;
description: string;
administrators: User[]; #1
}
interface User {
name: string;
email: string;
// ...
}
Inspect the ChatRoom representation to see the repeated administrators field that motivates full replacement. section 8.3.3
