{"record":{"id":"cc186938e478d30e","repo":"apereo/cas","slug":"found-configuration-property-as-a-map-w","errorCode":null,"errorMessage":"Found configuration property as a Map: [{}]:[{}] with values [{}]","messagePattern":"Found configuration property as a Map: \\[(.+?)\\]:\\[(.+?)\\] with values \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/metadata/ConfigurationMetadataPropertyCreator.java","lineNumber":162,"sourceCode":"                    }\n                    val resultingValue = propertyField.get(classInstance);\n                    val valueType = resultingValue.getClass();\n                    if (valueType.isArray()) {\n                        prop.setDefaultValue(Arrays.toString((Object[]) resultingValue));\n                    } else if (resultingValue instanceof final Collection<?> results) {\n                        if (!results.isEmpty()) {\n                            val values = results.stream()\n                                .map(Object::toString)\n                                .collect(Collectors.joining(\",\"));\n                            prop.setDefaultValue(values);\n                        }\n                    } else if (valueType.isPrimitive() || valueType.isEnum()\n                        || PRIMITIVES.containsKey(valueType.getSimpleName())\n                        || PRIMITIVES.containsKey(elementTypeStr)) {\n                        prop.setDefaultValue(resultingValue.toString());\n                    } else if (resultingValue instanceof final Map<?, ?> mappedValue) {\n                        if (!mappedValue.isEmpty()) {\n                            LOGGER.warn(\"Found configuration property as a Map: [{}]:[{}] with values [{}]\",\n                                variable.getNameAsString(), valueType.getName(), mappedValue);\n                        }\n                    } else if (!parentClass.endsWith(\"Properties\")) {\n                        LOGGER.debug(\"Cannot determine default value; Unknown configuration property type [{}]:[{}]\",\n                            variable.getNameAsString(), valueType.getName());\n                    }\n                }\n            } catch (final Exception e) {\n                LOGGER.error(\"Processing [{}]:[{}]. Error [{}]\", parentClass, name, e);\n                switch (exp) {\n                    case final LiteralStringValueExpr ex -> prop.setDefaultValue(ex.getValue());\n                    case final BooleanLiteralExpr ex -> prop.setDefaultValue(ex.getValue());\n                    case final FieldAccessExpr ex -> prop.setDefaultValue(ex.getNameAsString());\n                    default -> {\n                    }\n                }\n            }\n        }","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/metadata/ConfigurationMetadataPropertyCreator.java#L144-L180","documentation":"ConfigurationMetadataPropertyCreator builds Spring Boot configuration metadata from CAS @ConfigurationProperties source classes. When the default value of a property is a non-empty Map, it cannot be rendered as a simple metadata default, so this warning is emitted and the default is skipped. It signals a documentation/metadata gap, not a runtime failure of the property itself.","triggerScenarios":"During metadata generation (build-time ConfigurationMetadataGenerator or docs generation) a config model field has a Map type whose initialized default value is non-empty, e.g. a Map field initialized with default entries in the properties class.","commonSituations":"CAS developers adding a new @ConfigurationProperties field typed Map<String, X> with inline default values; contributors running metadata generation and seeing warnings for recently added map-typed properties; version upgrades introducing new map defaults.","solutions":["If you own the code, initialize Map-typed property fields empty (new HashMap<>() / Map.of()) and document defaults instead of embedding non-empty default maps.","Treat the warning as informational: the property still works at runtime; only the generated metadata default is missing.","Document the expected map keys/values in the property class javadoc or reference docs so users know the defaults.","If defaults are needed, consider a provider/default-populator bean rather than baking them into the model field."],"exampleFix":"// before\nprivate final Map<String, String> actions = CollectionUtils.wrap(\"default\", \"doSomething\");\n\n// after\nprivate final Map<String, String> actions = new HashMap<>();","handlingStrategy":"type-guard","validationCode":"if (resultingValue instanceof Map<?, ?> mappedValue && !mappedValue.isEmpty()) {\n    // metadata cannot represent this default; initialize the field empty instead\n}","typeGuard":"if (!(fieldDefault instanceof Map<?, ?> m) || m.isEmpty()) {\n    // safe: metadata generator can process this default\n}","tryCatchPattern":null,"preventionTips":["Initialize Map-typed configuration fields empty in CAS config model classes.","Run metadata generation locally before committing new @ConfigurationProperties fields.","Document map defaults in javadoc/reference docs rather than embedding them."],"tags":["configuration","metadata","build-time","map"],"backgroundTag":"unsupported-config-value","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}