SnakeYaml get stacked keys
问题 When this is my .yml file: test1: "string1" test2: test3: "string2" How do I get the value of test3 ? Map<String, Object> yamlFile = new Yaml().load(YamlFileInputStream); yamlFile.get("test1"); // output: string1 yamlFile.get("test2"); // output: {test3=string2} yamlFile.get("test2.test3"); // output: key not found 回答1: YAML does not have „stacked keys“ . It has nested mappings. The dot . is not a special character and can occur normally in a key, therefore you cannot use it for querying