mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 21:31:32 +00:00
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 |
||
|---|---|---|
| .. | ||
| command_json.rs | ||
| devcontainer_api.rs | ||
| devcontainer_json.rs | ||
| devcontainer_manifest.rs | ||
| docker.rs | ||
| features.rs | ||
| lib.rs | ||
| oci.rs | ||