Tags: goccy/go-yaml
Tags
Fix anchor reference regression in nested structures (#839) * Add failing test for anchor reference regression This test demonstrates a regression in v1.16.0 where anchors defined in unmapped struct fields cannot be referenced using direct aliases in nested map structures. The test currently fails with: could not find alias \"base_url\" This regression was introduced by PR #660 which removed the fallback to anchorNodeMap when resolving aliases. Test case: - Anchor defined in 'shared' field (not mapped to struct) - Direct alias reference in nested structure: defaults.http.url: *base_url - This pattern works in v1.15.0 but fails in v1.16.0+ Note: Existing tests only cover merge keys (<<:) which still work. This test covers direct alias references which are broken. * Fix anchor reference regression in nested structures This fixes the regression demonstrated by TestDecoder_AnchorInUnmappedField where anchors defined in unmapped struct fields could not be referenced using direct aliases in nested map structures. * Remove redundant aliasName variable As suggested by @goccy, eliminate the redundant aliasName variable and use the existing text variable instead, which holds the same value. https://github.com/goccy/go-yaml/pull/839/changes#r2670489037
Add support for RawMessage, similar to json.RawMessage (#790) * Add support for RawMessage, similar to json.RawMessage This adds a type that users can use to refer to raw data in the yaml for deferred decoding. Signed-off-by: Brian Goff <cpuguy83@gmail.com> * test: add suggested cases from #668 --------- Signed-off-by: Brian Goff <cpuguy83@gmail.com> Co-authored-by: Brian Goff <cpuguy83@gmail.com>
PreviousNext