I have this property class:
@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "app.prefix")
public class SomeProperties {
private Map<String, SomeEnum> someEnumMappings;
}
and in my application.yml:
app:
prefix:
someEnumMappings:
"Name-1": SOME_ENUM_1
"Anthr. Name": SOME_ENUM_2
but I get:
Failed to bind properties under 'app.prefix' to java.util.Map<java.lang.String, com.example.enums.SomeEnum>:
Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, com.example.enums.SomeEnum>]
What can I do to prevent it?
Edit: changed to suggested code, still doesn't work. Can someone point out link to ref. doc for this?
Edit 2: changed so it reflects my problem with . and - symbols.
Found an answer. My problem was with having . (dot) in String key.
So it turns out what I need to do in this case is to enclose key in "[]".
There is link to Spring Boot ref. doc for it.