How to dump empty key value to yaml?
See original GitHub issueNeed to get from js:
volumes:
data-volume:
not
volumes:
data-volume: null
not
volumes:
data-volume: ''
?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
python - Can I dump blank instead of null in yaml/pyyaml?
As the string null is hardcoded, there is no option to dump() to change that. The proper way to solve this in PyYAML...
Read more >Examples — Python YAML package documentation
first key/value pair of the child collection. If you want either or both of these (sequence within sequence, mapping within sequence) to begin...
Read more >PyYAML Documentation
Dumping YAML The yaml. dump function accepts a Python object and produces a YAML document. yaml. dump accepts the second optional argument,...
Read more >How to default null YAML values to empty strings when ...
An example of converting null YAML values to empty strings when using ytt for Kubernetes config templating. This approach uses Python's ...
Read more >The greatnesses and gotchas of YAML | by Sidney Liebrand
The solution is to use a language specific tag. This can be used to create keys that are complex data types such as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, currently I worked it around by using
JSON.parse(JSON.stringify(obj))
which removesundefined
.There are no such thing as
undefined
in yaml. This package implements spec, not just generating pretty texts 😃