DMP-4826: Return error when search does not meet minimum characters to prevent performance impacting queries from running #2687
+150
−2
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.
Links
Change description
Summary of Git Diff
The recent changes to the
CaseControllerSearchPostTest.java
,RequestValidator.java
, and OpenAPI specifications introduce additional validation tests for the/cases/search
endpoint. Specifically, the changes enforce minimum length requirements for several fields in the request body, ensuring they are between 3 and 2000 characters. These updates enhance the robustness of the API by preventing invalid requests from being processed.Highlights
New Test Cases Added:
event_text_contains
,judge_name
,defendant_name
, andcourthouse
fields. Each must be at least 3 characters long.Validation Rules Defined:
minLength
andmaxLength
constraints for:courthouse
judge_name
defendant_name
event_text_contains
Code Adjustments:
JSONAssert
andMockMvcResultMatchers
to support JSON response validation in test cases.This update aims to improve input validation and error handling for the API, enhancing overall reliability and user experience.
Does this PR introduce a breaking change? (check one with "x")