For example:
java -jar mySpringApplication --myJsonParameter="{\"myKey\":\"myValue\"}"
This should be resolved like that:
public class MyService {
@Autowired
//or @Value("myJsonParameter") ?
private MyInputDto myInputDto;
}
public class MyInputDto {
private String myKey;
}
The idea is to pass named parameter from command line (and following spring externalization practics) but inject Typed value parsed from json, not string.