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

devi pathak commented on FINERACT-2550:
---------------------------------------

Fix implemented in PR: https://github.com/apache/fineract/pull/5667

The issue was caused by unsupported templateType values not being validated in 
retrieveApprovalTemplate(...), resulting in null/empty responses.

This has been fixed by adding explicit validation and throwing 
NotSupportedLoanTemplateTypeException.

Test coverage has also been added to ensure this behavior is preserved.

> Unsupported templateType returns null response in LoansApiResource
> ------------------------------------------------------------------
>
>                 Key: FINERACT-2550
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2550
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: Loan
>            Reporter: devi pathak
>            Priority: Major
>              Labels: beginner, beginner-friendly
>
> In LoansApiResource.retrieveApprovalTemplate(...), unsupported templateType 
> values are not explicitly validated. As a result, the API returns a 
> successful response with a null/empty payload instead of throwing an error.
>  
> *Steps to Reproduce*
> 1. Call the loan approval template API with templateType set to an 
> unsupported value (e.g. "foo")
> 2. Observe that the API returns a 200 response with null/empty payload
>  
> *Expected Behavior*
> The API should validate templateType and throw 
> NotSupportedLoanTemplateTypeException for unsupported values.
>  
> *Actual Behavior*
> Unsupported templateType values are not handled explicitly, resulting in 
> null/empty responses.
>  
> *Proposed Solution*
> Add explicit validation for templateType and throw 
> NotSupportedLoanTemplateTypeException, consistent with other template-related 
> methods in LoansApiResource.
>  
> *Impact*
>  - Prevents silent failures
>  - Ensures consistent API behavior
>  - Improves error handling and reliability



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to