Replies: 1 comment
-
Many people think of adding an element to an array as a simple scalar operation; with YAML, it is vastly more complex due to YAML's native merge capabilities. Please refer to the following discussions for a deep-dive into why the Merger class (implemented in the
This documentation covers the Merger class and its reference implementation, the
That said, I'm always interested in making YAML Path better. The closest we've come to an idea for how to allow scalar, atomic additions to Arrays was a proposal to define a new YAML Path segment but that idea quickly fell apart. If you have a good answer for this question in #141, I'd be happy to explore it with you:
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I use yamlpath from python code, mainly to manipulate, like
processor.set_value(path, val)
. I wasn't able to find out how to append to a list, without knowing it's length beforehand. What is the correct yamlpath syntax for that?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions