Initially this is a test case to demonstrate what I'm hoping for. The test will fail, not 100% sure where to fix, maybe in encoder.go? I tried adding the below to the marshalMapping function but we get an extra indented line so figure there's more to it.
if len(node.Content) == 0 {
// This is an empty mapping node, we should return "{}"
return []byte("{}\n"), nil
}
Initially this is a test case to demonstrate what I'm hoping for. The test will fail, not 100% sure where to fix, maybe in
encoder.go
? I tried adding the below to themarshalMapping
function but we get an extra indented line so figure there's more to it.Here's an example of what happens without this support https://github.com/rawlingsj/wolfi-os/pull/2064/files#diff-c1e7e6d93bdcfdbf44020ead40b6f83e46b82b28422c8a70fd48accc5e6acdd0L44