How to read json as a string from a yaml file in spring boot application ?
I need to get the json as a string / json object.
Application.yml
Shirt:
rest:
booking:
invoiceAddress: {"name":"VIA Pics AB","address1":"VIA Pics AB","address2":"Mejerivägen 3","zipCode":"11743","city":"STOCKHOLM","countryCode":"SE","email":"w.ho@Pics.fr"}
Configuration class
@Configuration
public class ConfigurationServiceClientConfiguration {
@Value("${Shirt.rest.booking.invoiceAddress}")
private String invoiceAddress;
@Bean
public String getInvoiceAddress(){
System.out.println(invoiceAddress);
return this.invoiceAddress;
}
}
Also tried @JsonProperty but no idea whether my usage was wrong or not !
Note: I am not ready to change the json as a list because more jsons (of invoiceAddress) to come and I will have to make list for each. So it's easy for me if the json can be copied as it is to the yaml file.