Dhananjay Bhagat created FINERACT-2489:
------------------------------------------

             Summary: Omitting "charts" in Recurring Deposit Product creation 
causes NPE instead of validation error
                 Key: FINERACT-2489
                 URL: https://issues.apache.org/jira/browse/FINERACT-2489
             Project: Apache Fineract
          Issue Type: Bug
          Components: Savings
    Affects Versions: 1.15.0
            Reporter: Dhananjay Bhagat


When creating a Recurring Deposit Product via POST /v1/recurringdepositproducts 
API endpoint, the "charts" parameter is effectively mandatory.

If the parameter is omitted, the request currently results in a 
NullPointerException during validation 
(DepositProductDataValidator.validateChartsData), which leads to HTTP 500 
Internal Server Error.
h3. Steps to Reproduce:

1. Call POST /v1/recurringdepositproducts.
2. Provide valid payload but omit "charts".
h3. Current Result:
{code:java}
500 Internal Server Error.
{code}
h3. Expected Result:

The request should fail with a 400 Bad Request and return a validation message 
similar to other mandatory parameters. Example:
{code:java}
400 Bad Request
"The parameter `charts` is mandatory."
{code}
h3. Impact:

Clients receive a server-side failure instead of actionable validation 
feedback, and cannot easily determine how to correct the request.
h3. Proposed Direction:

Create a guard against null value before it reaches a flow that results in NPE. 
Rely on DataValidatorBuilder.notNull().jsonArrayNotEmpty() to produce 
consistent validation errors.

The API documentation should also reflect that "charts" is mandatory.



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

Reply via email to