question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to dump empty key value to yaml?

See original GitHub issue

Need to get from js:

volumes:
  data-volume:

not

volumes:
  data-volume: null

not

volumes:
  data-volume: ''

?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
wclrcommented, Jul 1, 2017

Ok, currently I worked it around by using JSON.parse(JSON.stringify(obj)) which removes undefined.

2reactions
puzrincommented, Jun 28, 2017

There are no such thing as undefined in yaml. This package implements spec, not just generating pretty texts 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found