[
https://issues.apache.org/jira/browse/FINERACT-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
devi pathak updated FINERACT-2550:
----------------------------------
Description:
In LoansApiResource.retrieveApprovalTemplate(...), when templateType is not
"approval", the API does not throw an error and instead returns a null/empty
response.
*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 successful response with null/empty payload
*Expected Behavior*
The API should validate templateType and reject unsupported values with a
proper exception.
*Actual Behavior*
Unsupported templateType values are not handled explicitly, resulting in a
null/empty response.
*Proposed Solution*
Add explicit validation for unsupported templateType and throw
NotSupportedLoanTemplateTypeException, similar to existing handling in other
methods of this class.
*Impact*
- Prevents silent failures
- Ensures consistent API behavior
- Improves error handling and reliability
was:
*Description*
In LoansApiResource.retrieveApprovalTemplate(...), when templateType is not
"approval", the API does not throw an error and instead returns a null/empty
response.
*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 successful response with null/empty payload
*Expected Behavior*
The API should validate templateType and reject unsupported values with a
proper exception.
*Actual Behavior*
Unsupported templateType values are not handled explicitly, resulting in a
null/empty response.
*Proposed Solution*
Add explicit validation for unsupported templateType and throw
NotSupportedLoanTemplateTypeException, similar to existing handling in other
methods of this class.
*Impact*
- Prevents silent failures
- Ensures consistent API behavior
- Improves error handling and reliability
> 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
>
> In LoansApiResource.retrieveApprovalTemplate(...), when templateType is not
> "approval", the API does not throw an error and instead returns a null/empty
> response.
> *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 successful response with null/empty payload
> *Expected Behavior*
> The API should validate templateType and reject unsupported values with a
> proper exception.
> *Actual Behavior*
> Unsupported templateType values are not handled explicitly, resulting in a
> null/empty response.
> *Proposed Solution*
> Add explicit validation for unsupported templateType and throw
> NotSupportedLoanTemplateTypeException, similar to existing handling in other
> methods of this class.
> *Impact*
> - Prevents silent failures
> - Ensures consistent API behavior
> - Improves error handling and reliability
--
This message was sent by Atlassian Jira
(v8.20.10#820010)