java:S5128 ("Bean Validation" (JSR 380) should be properly configured) rule should be configurable for fields and parameters separately

I’m using Bean Validation for Spring components annotated with @ConfigurationProperties in this way:

public class Props {
    public String string;

Then I create a Spring configuration where use this properties class:

public class SomeConfiguration {
    public SomeService someService(Props props) { // <-- Sonar tells that the parameter should be annotated with @Valid
        return new SomeService(props);

For SomeConfiguration.someService() method’s parameter props Sonar raises java:S5128 issue, telling that the parameter must be annotated with @Valid. However, it’s not required in Spring and it will be quite annoying to add @Valid in every method that uses Props type as a method parameter.

Unfortunately, I can’t exclude the rule for all method parameters, but keep it working for fields like private @Valid Props props or private List<@Valid Props> propsList.

The suggestion is to allow us to disable this rule for method parameters separately from fields. Basically, to allow to disable it for parameters but leave enabled for fields/getters.