zed/crates/dev_container/src
Kunall Banerjee cd12d5f98d
dev_container: Make all PortAttributes fields optional (#53799)
The Dev Container [metadata
reference](https://containers.dev/implementors/json_reference/#port-attributes)
defines all five `PortAttributes` fields (`elevateIfNeeded`, `label`,
`onAutoForward`, `protocol`, `requireLocalPort`) as optional with
defined defaults. The struct required all of them, causing
deserialization failures for any `portsAttributes` entry that omitted a
field.

Add `#[serde(default)]` to each field, wrap `label` and `protocol` in
`Option<T>` (spec default: not set), and derive `Default` on
`OnAutoForward` with `Notify` as the default variant (spec default:
`notify`). The bool fields already default to false via
`serde(default)`, matching the spec.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #53686.

Release Notes:

- Made all `PortAttributes` fields optional according to the Dev
Container spec
2026-04-20 10:05:12 -07:00
..
command_json.rs Dev containers native implementation (#52338) 2026-04-01 08:16:27 -07:00
devcontainer_api.rs Simplify remote workspace folder calculation for Dev Containers (#53829) 2026-04-16 11:50:08 -07:00
devcontainer_json.rs dev_container: Make all PortAttributes fields optional (#53799) 2026-04-20 10:05:12 -07:00
devcontainer_manifest.rs Use dockerfile build args correctly, respect context path, fix image aliasing (#54210) 2026-04-20 08:38:53 -07:00
docker.rs dev_container: Fix environment variables without an equals sign were treated as fatal parsing errors. (#53864) 2026-04-16 19:12:32 +00:00
features.rs Dev containers native implementation (#52338) 2026-04-01 08:16:27 -07:00
lib.rs Dev containers native implementation (#52338) 2026-04-01 08:16:27 -07:00
oci.rs Dev containers native implementation (#52338) 2026-04-01 08:16:27 -07:00