-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow empty arrays in proxy #127
Comments
Thanks for the bug report, generally gestalt fails if there is no data. |
Yes, but in some formats, like hocon, an array with 0 elements is different than "null", it's impossible to get that property even if it's valid |
Gestalt supports loading from 7 different formats, and has the capability to merge them. So we load each format, but then convert it into an internal representation. Unfortunately, From there we lose some of the special properties of each format.
Hopefully this will resolve the issue. But i haven't tested specifically with a proxy object, but only with a list, set and array. Once this is released please let me know if this works for you. |
It doesn't work on empty arrays. Attempting to get the empty array causes the following error:
The config looks like this: database: {
global: {
volumes: []
}
} |
If I set .setTreatNullValuesInClassAsErrors(false), it still doesn't help:
|
…will only be returned if a node has been defined, if the node doesnt exist it will still throw errors. #127
* feat: Allow empty collections to be returned instead of errors. They will only be returned if a node has been defined, if the node doesnt exist it will still throw errors. #127
Can you please try version 0.24.2 and let me know if it fixes the issue for you. |
It works, thanks! |
I have the following hocon config file:
If the volumes array is empty, i get the following error when I try to read
globalCfg.getVolumes();
:I noticed that the class ProxyInvocationHandler inside ProxyDecoder.java does not have any value related to null properties and empty array properties.
The text was updated successfully, but these errors were encountered: