FINERACT-2489: Fix NPE for missing charts in Recurring Deposit Product#5490
Open
Dhanno98 wants to merge 1 commit intoapache:developfrom
Open
Conversation
dc1e201 to
c160eb2
Compare
Contributor
Author
|
Rebased the branch onto the latest develop and force-pushed. Thank you! |
Contributor
Author
|
I checked the failed job and it appears that the failure in I have not modified any build or dependency configuration in this PR but please let me know if you think I should investigate anything further or rebase once this is resolved in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements FINERACT-2489.
Problem
While creating a Recurring Deposit Product using POST
/v1/recurringdepositproducts, the request fails with HTTP 500 Internal Server Error when thechartsparameter is omitted.Current Behavior
The validation flow effectively requires
chartsas required. However, when it is missing a NullPointerException occurs insideDepositProductDataValidator.validateChartsData()before the validation framework can return a proper validation error.So the users receive a 500 response instead of a 400 along with a meaningful validation message.
Why this happens
Unlike optional parameters, the code path for
chartsdoes not checkparameterExists()before validation, which indicates the parameter is mandatory.DataValidatorBuilder.notNull().jsonArrayNotEmpty()is already present but execution proceeds further and triggers NPE.What this PR does
chartsfrom Optional Fields to Mandatory Fields.Result after fix
If
chartsis missing, the API now returns a consistent validation error, similar to other mandatory fields.No functional behavior is changed beyond improving error handling and documentation alignment.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.