[SPIGOT-3151] Spigot is not correctly parsing YAML files. Created: 25/Mar/17 Updated: 25/Mar/17 Resolved: 25/Mar/17 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Luke Anderson | Assignee: | Unassigned |
Resolution: | Invalid | Votes: | 0 |
Labels: | Configuration, config, yaml, yml |
Description |
When loading the following configuration file: https://gist.github.com/stuntguy3000/27576af93e868a33baed108bf3bf2fdc Spigot throws this error - despite the YAML being valid. (www.yamllint.com, www.yaml-online-parser.appspot.com) java.lang.IllegalArgumentException: Cannot set to an empty path
Removing lines 7, 13, 19 and 25 allow the config to be loaded. |
Comments |
Comment by md_5 [ 25/Mar/17 ] |
This is not a valid yaml document in the way you think it is. foo:
bar.:
baz: "daz"
Why? Because bar has a trailing . and would thus create an empty section. getConfigurationSection( "foo" ).getConfigurationSection( "bar" ).getConfigurationSection( "" ) Which makes absolutely no sense - blank section as the error says. Now if you look at your config, you've actually created a section that looks like this: rewards: STONE: say yolo xd torch;1;0;&b&l&oSky&3&l&oLight;&fSkylights&5 can be redeemed|with staff to create &fwarps|and light &fnether_portals.: say xd In other words you have a section which has a key of "torch;1;0;&b&l&oSky&3&l&oLight;&fSkylights&5 can be redeemed|with staff to create &fwarps|and light &fnether_portals." - note the trailing dot. If you really want to allow this you can set the path separator to something other than dot, however I think your config makes no sense because why exactly would that huge monstrosity be the KEY of something. Remember keys should be short descriptors of the data, not actually the data itself which is you what appear to have there. |
Comment by Luke Anderson [ 25/Mar/17 ] |
I have performed a bit more testing, the issue is the period in the key name. |
Comment by Luke Anderson [ 25/Mar/17 ] |
https://gist.github.com/stuntguy3000/27576af93e868a33baed108bf3bf2fdc |