Skip to content

Commit c221072

Browse files
committed
Document override extendsMergeMode as full top-level replace
Align spec and schema with spread semantics: set properties replace the inherited value entirely; omitted properties keep the chain below.
1 parent 9f8d6d7 commit c221072

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎docs/specs/devcontainerjson-reference.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,10 @@ Uses the same [merge logic](devcontainer-reference.md#merge-logic) applied to im
7373

7474
### `extendsMergeMode`: `override`
7575

76-
Uses overlay-style merging when the current file should replace rather than combine with the base:
76+
Uses overlay-style merging when the current file should replace inherited values rather than combine with the base (`{ ...base, ...current }`):
7777

78-
- Arrays and scalars from the current file replace the base when set on the current file (for example, `forwardPorts` is only the current file's list).
79-
- Object maps and `hostRequirements` are shallow-merged per key, with the current file winning on conflicts.
80-
- Boolean `init` and `privileged` use the current file's value when set.
78+
- Each top-level property set on the current file fully replaces the inherited value (arrays, object maps, `hostRequirements`, scalars, and booleans).
79+
- Top-level properties omitted on the current file keep the value from the referenced configuration chain.
8180

8281
Neither `extends` nor `extendsMergeMode` is present in the merged result.
8382

‎schemas/devContainer.base.schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"combine",
2727
"override"
2828
],
29-
"description": "How to merge the referenced extends file with this file. combine (default) uses the image metadata merge logic. override replaces arrays and scalars from this file and shallow-merges object maps and hostRequirements."
29+
"description": "How to merge the referenced extends file with this file. combine (default) uses the image metadata merge logic. override uses spread semantics: each top-level property set on this file fully replaces the inherited value; omitted properties keep the inherited value."
3030
},
3131
"features": {
3232
"type": "object",

0 commit comments

Comments
 (0)