dev_container: Make all PortAttributes fields optional#53799
Merged
KyleBarton merged 3 commits intomainfrom Apr 20, 2026
Merged
dev_container: Make all PortAttributes fields optional#53799KyleBarton merged 3 commits intomainfrom
PortAttributes fields optional#53799KyleBarton merged 3 commits intomainfrom
Conversation
…er spec The devcontainer JSON reference defines all five PortAttributes fields (label, protocol, onAutoForward, requireLocalPort, elevateIfNeeded) 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.
Member
Author
|
@KyleBarton -- there you go. Thanks for the review! 💖 |
KyleBarton
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Dev Container metadata reference defines all five
PortAttributesfields (elevateIfNeeded,label,onAutoForward,protocol,requireLocalPort) as optional with defined defaults. The struct required all of them, causing deserialization failures for anyportsAttributesentry that omitted a field.Add
#[serde(default)]to each field, wraplabelandprotocolinOption<T>(spec default: not set), and deriveDefaultonOnAutoForwardwithNotifyas the default variant (spec default:notify). The bool fields already default to false viaserde(default), matching the spec.Self-Review Checklist:
Closes #53686.
Release Notes:
PortAttributesfields optional according to the Dev Container spec