docs(spec): extend auto_discovery schema with parent_types and detection fields #6313

Closed
HAL9000 wants to merge 1 commits from spec/devcontainer-auto-discovery-schema into master
+26
View File
@@ -34672,6 +34672,29 @@ The following is the formal [JSON Schema](https://json-schema.org/) definition f
<span style="color: cyan; font-weight: 600;">&quot;type&quot;</span>: <span style="color: #66cc66;">&quot;array&quot;</span>,
<span style="color: cyan; font-weight: 600;">&quot;items&quot;</span>: { <span style="color: cyan; font-weight: 600;">&quot;type&quot;</span>: <span style="color: #66cc66;">&quot;string&quot;</span> },
<span style="color: cyan; font-weight: 600;">&quot;description&quot;</span>: <span style="color: #66cc66;">&quot;Glob patterns for resources to skip during discovery.&quot;</span>
},
<span style="color: cyan; font-weight: 600;">&quot;parent_types&quot;</span>: {
<span style="color: cyan; font-weight: 600;">&quot;type&quot;</span>: <span style="color: #66cc66;">&quot;array&quot;</span>,
<span style="color: cyan; font-weight: 600;">&quot;items&quot;</span>: { <span style="color: cyan; font-weight: 600;">&quot;type&quot;</span>: <span style="color: #66cc66;">&quot;string&quot;</span> },
<span style="color: cyan; font-weight: 600;">&quot;description&quot;</span>: <span style="color: #66cc66;">&quot;Resource types that trigger auto-discovery of this child type. When a resource of one of these parent types is registered, the system scans for children of this type.&quot;</span>
},
<span style="color: cyan; font-weight: 600;">&quot;detection&quot;</span>: {
<span style="color: cyan; font-weight: 600;">&quot;type&quot;</span>: <span style="color: #66cc66;">&quot;object&quot;</span>,
<span style="color: cyan; font-weight: 600;">&quot;description&quot;</span>: <span style="color: #66cc66;">&quot;Detection configuration for child resource discovery.&quot;</span>,
<span style="color: cyan; font-weight: 600;">&quot;properties&quot;</span>: {
<span style="color: cyan; font-weight: 600;">&quot;scan_paths&quot;</span>: {
<span style="color: cyan; font-weight: 600;">&quot;type&quot;</span>: <span style="color: #66cc66;">&quot;array&quot;</span>,
<span style="color: cyan; font-weight: 600;">&quot;items&quot;</span>: { <span style="color: cyan; font-weight: 600;">&quot;type&quot;</span>: <span style="color: #66cc66;">&quot;string&quot;</span> },
<span style="color: cyan; font-weight: 600;">&quot;description&quot;</span>: <span style="color: #66cc66;">&quot;Relative paths (from the parent resource root) to check for the presence of this child resource type. If any path exists, a child resource is created.&quot;</span>
},
<span style="color: cyan; font-weight: 600;">&quot;activation&quot;</span>: {
<span style="color: cyan; font-weight: 600;">&quot;type&quot;</span>: <span style="color: #66cc66;">&quot;string&quot;</span>,
<span style="color: cyan; font-weight: 600;">&quot;enum&quot;</span>: [<span style="color: #66cc66;">&quot;eager&quot;</span>, <span style="color: #66cc66;">&quot;lazy&quot;</span>],
<span style="color: cyan; font-weight: 600;">&quot;default&quot;</span>: <span style="color: #66cc66;">&quot;lazy&quot;</span>,
<span style="color: cyan; font-weight: 600;">&quot;description&quot;</span>: <span style="color: #66cc66;">&quot;When to activate the discovered child resource. &#x27;lazy&#x27; means the child is registered but not built/started until first needed. &#x27;eager&#x27; means the child is activated immediately at discovery time.&quot;</span>
}
},
<span style="color: cyan; font-weight: 600;">&quot;additionalProperties&quot;</span>: <span style="color: magenta; font-weight: 600;">false</span>
}
},
<span style="color: cyan; font-weight: 600;">&quot;additionalProperties&quot;</span>: <span style="color: magenta; font-weight: 600;">false</span>
@@ -34903,6 +34926,9 @@ The following annotated YAML provides an easier-to-read overview of the same sch
| `scan_depth` | integer | No | Maximum recursion depth for scanning. Default: `3`. |
| `include_patterns` | list | No | Glob patterns for resources to discover. |
| `exclude_patterns` | list | No | Glob patterns for resources to skip during discovery. |
| `parent_types` | list | No | Resource types that trigger auto-discovery of this child type. When a resource of one of these parent types is registered, the system scans for children of this type. Used by built-in types such as `devcontainer-instance` (triggered by `git-checkout`). |
| `detection.scan_paths` | list | No | Relative paths (from the parent resource root) to check for the presence of this child resource type. If any path exists, a child resource is created. Example: `[".devcontainer/devcontainer.json", ".devcontainer.json"]`. |
| `detection.activation` | string | No | When to activate the discovered child resource. `lazy` (default) means the child is registered but not built/started until first needed. `eager` means the child is activated immediately at discovery time. |
**Equivalence Fields (`equivalence`) — Virtual Types Only**