Skip to content
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

Freeform Map<String,String> configuration properties always marked as required #42513

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,11 @@ private void resolveProperty(ConfigRoot configRoot, Map<String, ConfigSection> e
}

String potentiallyMappedPath = propertyPath;
boolean optional = discoveryConfigProperty.getType().isOptional();

if (discoveryConfigProperty.getType().isMap()) {
// it is a leaf pass through map
// it is a leaf pass through map, it is always optional
optional = true;
typeQualifiedName = discoveryConfigProperty.getType().wrapperType().toString();
typeSimplifiedName = utils.element().simplifyGenericType(discoveryConfigProperty.getType().wrapperType());

Expand All @@ -192,7 +194,7 @@ private void resolveProperty(ConfigRoot configRoot, Map<String, ConfigSection> e
discoveryConfigProperty.getSourceName(), potentiallyMappedPath, additionalPaths,
ConfigNamingUtil.toEnvVarName(potentiallyMappedPath), typeQualifiedName, typeSimplifiedName,
discoveryConfigProperty.getType().isMap(), discoveryConfigProperty.getType().isList(),
discoveryConfigProperty.getType().isOptional(), discoveryConfigProperty.getMapKey(),
optional, discoveryConfigProperty.getMapKey(),
discoveryConfigProperty.isUnnamedMapKey(), context.isWithinMap(),
discoveryConfigProperty.isConverted(),
discoveryConfigProperty.getType().isEnum(),
Expand Down
Loading