Open yxxhero opened 1 year ago
@goccy could you give me a favor?
I did not understand that multiple values can be used for merge key. So, the bug needs to be fixed.
@goccy Thanks for your reply.
Some pointers about the yaml merge key feature: There only exists a spec draft for merge keys: https://yaml.org/type/merge.html
The relevant language about sequences: "If the value associated with the merge key is a sequence, then this sequence is expected to contain mapping nodes and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier in the sequence override keys specified in later mapping nodes."
I have found that you already use the example yaml from the spec draft in your parser tests: https://github.com/goccy/go-yaml/blob/0640a158e99023787bc503fd4476e472d804c3a3/parser/parser_test.go#L305-L330
However in decode_test.go you only test for a subset of the spec draft, and don't use the spec draft example yaml: https://github.com/goccy/go-yaml/blob/0640a158e99023787bc503fd4476e472d804c3a3/decode_test.go#L1323-L1332