I'm having trouble setting null
as a property value.
This is how the value is defined in YAML file:
my-property: null
This is how I inject it in code:
@Value("${my-property}")
private String myProperty;
For some reason, Spring keeps injecting an empty string ("") instead of null
. Am I missing something or is this an error in Spring?