I don't get an answer in stackoverflow, so I post here my question:
http://stackoverflow.com/questions/34041197/how-to-define-default-null-value-in-application-yml-in-spring-boot
The question on Stack Overflow is still open so there's no need for this issue. Thanks.
There is still no answer to this problem on stackoverflow.com, do you have a solution to be able to specify the null value to a property?
ex :
my.property=${null}
You can set to null in porperty file (i don't know yaml) by:
some.property=#{null}
or at java side by:
@Value("${some.property:#{null}}")
You can set to null in porperty file (i don't know yaml) by:
some.property=#{null}or at java side by:
@value("${some.property:#{null}}")
That doesn't work. Spring doesn't evaluate SpEL in properties files: https://github.com/spring-projects/spring-boot/issues/1672
As far as I can tell, there is no way to specify a null value in application.properties or application.yml (in yaml, that seems to be a bug though, and no by design - see https://jira.spring.io/browse/SPR-15425 )
Hi,
you need to set it like that:
some:
property: '#{null}'
Hi,
you need to set it like that:some: property: '#{null}'
That's wrong - there will be "#{null}" value in String...