[ 
https://issues.apache.org/jira/browse/FINERACT-2906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125390#comment-18125390
 ] 

Suvrat Acharya commented on FINERACT-2906:
------------------------------------------

Yeah I just noticed that you opened a pr but the pr wasn't linked here which 
caused my confusion. 

> 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)

Reply via email to