-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging Lists #469
Comments
+1 |
yaml/yaml#35 talks about it at length and yaml/yaml#48 tries to suggest new syntax to YAML. I hope it goes somewhere some day soon! |
The right way to do this is something like:
which you can do now by registering a function for YAML 1.3 in design now, will likely make that easy to do in a standard way possibly without even needing the explicit tag. It will almost certainly have standard functions defined for things like merging. @RishabhMalviya k8s might not let you do this directly at this time, but you could preprocess with PyYAML. Or preprocess with many other non-YAML preprocessing solutions. PS You can now engage directly with YAML language design team using https://matrix.to/#/#chat:yaml.io |
I've been trying to find a way to merge lists in YAML. There are a number of StackOverflow questions trying to do the same:
All of the solutions suggested are workarounds:
requires the resultant list to be flattened, which leads to suggestions like adding a
!flatten
tag that will then have to be specially processed by whatever is the underlying parser (e.g., PyYAML).Unfortunately, these workarounds aren't viable for me, because I need to do this in a
docker-compose.yml
file; so I have no control over the parser's behavior.I would like to understand why this is not possible in YAML? I'm assuming there is something fundamental to the YAML Information Model that makes this impossible, since some of those SO posts were 8 years old. Any pointers are appreciated.
Ideally, I would like to help decide on some syntax, and then make the necessary changes in this repo. These changes would then transitively become available to use in docker-compose (which is also a Python package) whenever they decide to upgrade the underlying pyyaml parser version.
The text was updated successfully, but these errors were encountered: