Files
zed/crates
Kunall Banerjee 3663fdb5cc 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
..
2026-04-17 10:51:32 -04:00
2026-04-05 23:05:35 +01:00
2026-03-27 14:56:46 -07:00
2026-03-11 03:08:39 +00:00
2026-03-30 09:06:59 +00:00
2026-02-26 18:36:50 +01:00
2026-04-18 06:34:19 +00:00
2026-04-18 06:34:19 +00:00
2026-04-18 06:34:19 +00:00
2026-04-09 14:11:55 -04:00