[
https://issues.apache.org/jira/browse/FINERACT-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Adam Saghy resolved FINERACT-2550.
----------------------------------
Fix Version/s: 1.15.0
Resolution: Fixed
> 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
> Fix For: 1.15.0
>
>
> 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)