[ https://issues.apache.org/jira/browse/FINERACT-2906 ]
Suvrat Acharya deleted comment on FINERACT-2906:
------------------------------------------
was (Author: JIRAUSER308165):
Hey [~samchenko], are you working on this? Being a new contributor I think I
could take this up. I read the code and I think I can come up with a fix for
this.
cc [~adamsaghy] Could you assign this to me if Vladyslav isn't working on it?
> SmsDataValidator does not reject a null staffId on SMS creation
> ---------------------------------------------------------------
>
> Key: FINERACT-2906
> URL: https://issues.apache.org/jira/browse/FINERACT-2906
> Project: Apache Fineract
> Issue Type: Bug
> Reporter: Vladyslav Samchenko
> Assignee: Vladyslav Samchenko
> Priority: Trivial
>
> {{SmsDataValidator.validateForCreate}} accepts a JSON payload containing an
> explicit {{"staffId": null}} without raising a validation error. However, the
> only consumer of this validator, {{{}SmsMessageAssembler{}}}, cannot handle a
> null {{{}staffId{}}}: it unconditionally calls
> {{{}StaffRepositoryWrapper.findOneWithNotFoundDetection(null){}}}, which
> fails with an {{IllegalArgumentException}} from Spring Data's
> {{Assert.notNull}} rather than a domain-specific validation exception.
> The two components are inconsistent. Either {{staffId = null}} is a valid
> input, in which case the assembler must handle it, or it is invalid, in which
> case the validator must reject it. They cannot both be correct, so at least
> one component is defective regardless of the original intent.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)