Reading yaml comments not working
See original GitHub issueHi! I have been looking into this project because of the comment support that I couldn’t find in snakeyaml. The docs guided me mostly through, and I saw comments are used everywhere. I made my own ConfigManager class to manage the currently saved config and merging values from a default mapping. Sadly in the process comments got lost. I looked into it and saw that it was the reader. This is the class I made: Github Gist I am making a spigot plugin. The main class only provides me with the folder where to store the files (#getDataFolder()) and a short way of getting a resource as an input stream (#getResource(String)). This is my config.yml resource file:
# test
test: true
# test2
test2: false
And this is the console log:
[08:47:05 INFO]: test: true
[08:47:05 INFO]: test2: false
[08:47:05 INFO]: test: true
[08:47:05 INFO]: test2: true
[08:47:05 INFO]: test: true
[08:47:05 INFO]: test2: true
As you can see no comments got readed nor logged. So I am wondering if it’s not a feature yet, or it is a bug. Am I maybe missing some API or method calls?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top GitHub Comments
@amihaiemil It seems to work seamlessly now. I didn’t notice that only yamlsequances were allowed to have comments above them. Doing as you said:
Works great. The comments get merged together with their node into the mapping. Thanks for this awesome project!
@amihaiemil thank you for resolving this ticket. I’ve just added it to your active invoice. You can always check all your invoices and more on the Contributor Dashboard.