cannot dump IP address as String

Issue #328 resolved
Former user created an issue

I'm using SnakeYAML 1.11 in Java 7 / Java 8. Say I have a map of "hostname" and "127.0.0.1", and want to dump it as a yaml file.

Map<String, String> config = new HashMap<String, String>();
config.put("hostname", "127.0.0.1");
Yaml yaml = new Yaml();
yaml.dumpAsMap(config);

The output is {hostname: 127.0.0.1} instead of {hostname: "127.0.0.1"} and the former won't be loaded as String.

Comments (2)

  1. Log in to comment