Skip to content

Commit de04ff6

Browse files
Copilotmoltude
andauthored
Fix parameter validation to reject over-limit values instead of clamping (#94)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: moltude <1419766+moltude@users.noreply.github.com>
1 parent 0e2a1b7 commit de04ff6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/scala/dpla/api/v2/search/paramValidators/ParamValidator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ trait ParamValidator extends FieldDefinitions {
499499
Try(intString.toInt).toOption match {
500500
case Some(int) =>
501501
if (int < min) throw ValidationException(rule)
502-
else if (int > max) max
502+
else if (int > max) throw ValidationException(rule)
503503
else int
504504
case None =>
505505
// not an integer

0 commit comments

Comments
 (0)