AuthMe/ConfigMe

Overlapping property with root property "" creates invalid YAML

ljacqu opened this issue · 1 comments

ljacqu commented

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

(Kind of) breaking change

  • Prior to 1.4.0, ConfigMe "tolerated" a property at path "" to exist alongside other properties. This was never the intention since the paths of multiple properties overlap, which ConfigMe otherwise prevents. Conflicts are now also prevented for root properties (= property at path "").

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