If you need to pass the asterisk symbol, you have to wrap it with quotes.
In my case, I need to configure cors for websockets. So, I decided to put cors urls into application.yml. For prod env I'll use specific urls, but for dev it's ok to use just *.
In yml file I have:
websocket:
cors: "*"
In Config class I have:
@Value("${websocket.cors}")
private String[] cors;