Open goombamaui opened 9 months ago
It is intended behaviour. However, nesting objects like this is something I would like to support.
Your mixin method does flatten the whole config into the root object in the json, so an approach like this is not what I'd like.
In the previous version of yacl, where config instances were built like so:
GsonConfigInstance.createBuilder(c) .setPath( Path.of(CONFIG_PATH,"cfg.json")).build();
If there was an abstract classA
with a@ConfigEntry
field, and it was extended by classB
, thenGsonConfigInstance.createBuilder(B.class)
would, when built and saved, end up saving an instance of the@ConfigEntry
fields in the abstract class. However, in the new version, where a config class handler is created as follows:ConfigClassHandler.createBuilder(c)
Inherited fields are not saved in the config. Is this intended behavior for the new version?A simple mixin can be used to emulate the behavior of previous versions: