Hello. Last week we migrated our projects from spring boot 2.3.12.RELEASE to spring boot 2.7.11 and after that our projects are not starting anymore with the following exception :
Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.util.LinkedHashMap<?, ?>] to type
This happens for entries that are defined as empty objects in the YML file. I attached a sample project
Comment From: wilkinsona
The change in behavior is due to https://github.com/spring-projects/spring-boot/pull/21704 which has affected the behavior of YamlProcessor's building of the flattened map.
Prior to #21704, the value of person.address was an empty map which the flattening process dropped completely. With the change for #21704 in place, the value of person.address is an OriginTrackedValue that wraps the empty map. This wrapper isn't an instance of String, Map, or Collection so it's added as-is to the result map.
My memory about #21704 is quite hazy but the change appears to contradict our decision to decline https://github.com/spring-projects/spring-boot/issues/19095. I'm not sure if we changed our minds on #19095 or overlooked an implication of #21704. We'll discuss this one as a team and figure out what to do. In the meantime, hopefully you can remove the empty map from your YAML. This will restore Spring Boot 2.3's behavior which was ignoring it anyway.
Comment From: philwebb
After some consideration I think we should revert #21704. I don't think we should be adding Collection types to the PropertySource. Following the trail, it seems like #21704 was a fix for #20506 which was driven by https://github.com/spring-cloud/spring-cloud-config/issues/1572. That Spring Cloud issue was fixed by https://github.com/spring-cloud/spring-cloud-config/commit/0771829dc3e98875fc7fba70a4cf3876e39b8c3c.