Carleslc / Simple-YAML

This Java API provides an easy-to-use way to store data and provide configurations using the YAML format.
https://carleslc.me/Simple-YAML
GNU General Public License v3.0
132 stars 38 forks source link

Invalid configuration caused by the library itself? #63

Closed bi3her closed 2 years ago

bi3her commented 2 years ago

I don't write the yaml file manually, I use the library to do all that. But, for some reason, the configuration is still wrong? image that's the line where the error is. image and that's the error. What's the issue here? Keep in mind, this is a List that contains all these elements that I injected into '1'

Carleslc commented 2 years ago

Can you provide a code example to reproduce the issue?

Carleslc commented 2 years ago

I cannot reproduce the issue, please provide your failing code.

Also ensure you're using the latest version of the library.

I was suspicious about using \n in a list element, but I tried and it's working for me with the following code in Simple-Yaml version 1.8:

YamlFile yamlFile = new YamlFile("examples/test63.yml");

yamlFile.createOrLoad();

List<String> list = List.of("749", "1912", "11180 snowballs 25/1\n7 each, 942 candy block", "890");

yamlFile.set("months.1", list);

yamlFile.save();

yamlFile.load();

System.out.println(yamlFile);
months:
  '1':
    - '749'
    - '1912'
    - |-
      11180 snowballs 25/1
      7 each, 942 candy block
    - '890'
Carleslc commented 2 years ago

I'm closing the issue for the time being until providing the failing code.

Ensure you're using the latest version.

If you're still having this issue with the latest version then feel free to open the issue again providing more details to reproduce it.