AuthMe / ConfigMe

A simple configuration management library for any Java project!
MIT License
37 stars 14 forks source link

Overlapping property with root property "" creates invalid YAML #363

Closed ljacqu closed 1 year ago

ljacqu commented 1 year ago

Reported by Wector11211—

Defining a property at empty string "" and another one like path "enabled" will result in invalid YAML being produced:

? ''
:   foo:
        # Comment that is present on all instances
        servers: []
    bar:
        # Comment that is present on all instances
        servers: []
enabled: true

I confirmed that this worked in 1.3. Expected would be an exception just like when two properties use the same path, or one property has a conflict with another property (like foo.bar and foo.bar.baz)

ljacqu commented 1 year ago

(Kind of) breaking change

If you used this behavior previously, put the root property under some other path. With a class implementing MigrationService, you can move existing data from the root property to the new path. See Wiki: Migration service