libs/dyn/convert: suppress "unknown field" warnings for anchor containers#5975
Merged
Conversation
…ners
Bundle validation already suppresses "unknown field" warnings for
standalone YAML anchors, but still warns when anchors are grouped inside
a list or map, the common pattern of collecting reusable blocks under an
x-* key:
x-anchors:
- &a { name: foo }
- &b { name: bar }
This adds a recursive isAnchorContainer check so a non-empty sequence or
map whose elements are all anchors (or all anchor containers) is treated
the same as a standalone anchor and does not trigger the warning. Empty
containers and containers with any non-anchor element still warn as
before. The unknown field is dropped from the normalized output
regardless; only the spurious warning is suppressed.
Co-authored-by: Isaac
Co-authored-by: Isaac
The suppression does not depend on the x-* prefix, so use plain keys. Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Collaborator
Integration test reportCommit: 286272a
8 interesting tests: 4 RECOVERED, 4 SKIP
Top 10 slowest tests (at least 2 minutes):
|
andrewnester
approved these changes
Jul 20, 2026
The acceptance test only exercised the no-warning path. Extend it to also cover a container nested inside a container and a mixed container that holds a non-anchor element (which is reported as an unknown field), documenting the rationale for not suppressing the mixed case. Co-authored-by: Isaac
Remove the parenthetical about x-* keys from the isAnchorContainer doc comment and rename the unit test's unknown field from x-thing to thing, so neither uses the x- prefix. Co-authored-by: Isaac
pietern
enabled auto-merge
July 21, 2026 14:20
janniklasrose
approved these changes
Jul 21, 2026
Collaborator
Integration test reportCommit: 1365452
8 interesting tests: 4 SKIP, 3 KNOWN, 1 RECOVERED
Top 3 slowest tests (at least 2 minutes):
|
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.
Bundle validation already suppresses "unknown field" warnings for standalone YAML anchors, but still warns when anchors are grouped inside a list or map, the common pattern of collecting reusable blocks under an
x-*key:This adds a recursive
isAnchorContainercheck so a non-empty sequence or map whose elements are all anchors (or all anchor containers) is treated the same as a standalone anchor and does not trigger the warning. Empty containers and containers with any non-anchor element still warn as before. The unknown field is dropped from the normalized output regardless; only the spurious warning is suppressed.This pull request and its description were written by Isaac.