Need a way to specify empty list/array in microprofile-config.properties
See original GitHub issueThe MicroProfile Config spec currently specifies that Array Converters are built in, and provides examples of how to configure values that are multiple array elements (delimit by ,
). However, it does not appear to document how to configure a value that is an empty array.
On one implementation, I tried out specifying an empty value, like this,
test.property.name=
but it ended up with a value that is an array of size 1 containing the empty string.
I also tried out specifying the value as the value of the org.eclipse.microprofile.config.inject.ConfigProperty.UNCONFIGURED_VALUE constant (lacks documentation, so not sure if this is proper usage. Also, it seems to have two different values depending on which version of the ConfigProperty class is used),
test.property.name.1=org.eclipse.microprofile.config.configproperty.unconfigureddvalue
test.property.name.2=org.eclipse.microprofile.config.configproperty.unconfiguredvalue
but this resulted in a size 1 array containing the specified constant value.
It’s likely the above behavior is to be expected, but the requirement to be able to specify an empty list also seems valid. In another MicroProfile spec, we are utilizing MicroProfile Config to allow the user to supply configuration property values, some of which are lists/arrays. It ought to be possible for MicroProfile Config to have a standard way to set these list/array values to empty.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (9 by maintainers)
Top GitHub Comments
@OndroMih iirc you can’t write
myPets=dog,cat,dog\,cat
as\,
is not a valid Java character so you have to double the\
to be able to read it properlyRelated to #531.