Skip to content

Tag: yaml

Property file reading error in spring boot

Below is my yml file in spring boot app below value access is working file but when I try to access in below way it gives an error. I checked it gives error only when add “com.cloudimpl.outstack.runtime.EventRepositoryFactory” this part. How can I solve this?? Answer It doesn’t work so. You …

YamlSlurper cannot parse Enum value

I have yaml: Parsing file using YamlSlurper: error: java.lang.ClassCastException: java.lang.String cannot be cast to model.FlowType Is there a way to solve this? Answer The YAML slurper is a cute tool to quickly read a YAML file or string and deal with it to the degree, that you would use the other slurpers: …

How to flatten dynamic yaml file using java

I want to parse dynamic yaml files using java into HashMap and access them using dot syntax (i.e “a.b.d”) Given the following example.yml: And can fetch it as Any idea How we can achieve this? Answer As Thorbjørn said in a comment, a HashMap is probably not the correct data structure for represent…

map yaml config to a java hashmap

I have below in my yaml I am map it in my spring bean as follow, I get below error, Cannot convert value of type [java.lang.String] to required type [java.util.Map]: no matching editors or conversion strategy found How can I map a configuration map representation to a java hashmap? Answer In yaml try to forma…