why ”86:00.0“ change to “ 5160.0”,and how to solve this problem? thanks
Issue #484
invalid
Yaml yaml = new Yaml();
String yamlStr = "value:\n"
+ " - {a: 'b', c: 86:00.0}\n";
LinkedHashMap<String, Object> map = yaml.loadAs(yamlStr, LinkedHashMap.class);
System.out.println( ((Map)((List)map.get("value")).get(0)).get("c") );
show result
5160.0
Process finished with exit code 0
Comments (4)
-
-
- changed status to invalid
As specified in YAML 1.1
-
reporter thanks, now I extend Resolver class and remove int and float tag, I want to all value define as string type.
-
You can migrate to SnakeYAML Engine (https://bitbucket.org/asomov/snakeyaml-engine/) where this conversion is not used by default
- Log in to comment
As designed (see the example for base 60)
https://yaml.org/type/float.html
You can change this providing your own Resolver