[
https://issues.apache.org/jira/browse/FINERACT-2472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Krishna Mewara resolved FINERACT-2472.
--------------------------------------
Resolution: Fixed
> [Credit Bureau] Missing loanProductId in Mapping API throws 500 NPE instead
> of 400 Validation Error
> ---------------------------------------------------------------------------------------------------
>
> Key: FINERACT-2472
> URL: https://issues.apache.org/jira/browse/FINERACT-2472
> Project: Apache Fineract
> Issue Type: Bug
> Components: Accounting, Loan
> Affects Versions: 1.14.0
> Environment: Develop Branch
> Reporter: Krishna Mewara
> Priority: Major
> Labels: credit-bureau, validation
>
> *Overview* When creating a Credit Bureau Loan Product Mapping, if the
> mandatory field {{loanProductId}} is missing from the JSON payload, the
> server returns a 500 Internal Server Error (caused by a NullPointerException)
> instead of a 400 Bad Request.
> *Steps to Reproduce*
> # Send a POST request to:
> {{/fineract-provider/api/v1/CreditBureauConfiguration/mappings/\{organisationCreditBureauId}}}
> # Use a JSON body that omits {{{}loanProductId{}}}:
> { "isCreditcheckMandatory": true, "skipCreditcheckInFailure": false,
> "stalePeriod": 30, "isActive": true }
> *Expected Behavior* The API should return HTTP 400 Bad Request with a clear
> validation error (e.g., "The parameter loanProductId is mandatory").
> *Actual Behavior* The API returns HTTP 500 Internal Server Error.
> *Impact* This prevents clients from handling validation errors gracefully and
> clogs server logs with stack traces for simple user input errors.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)