Skip to content

Conversation

Copy link

Copilot AI commented Dec 9, 2025

Line 502 in ParamValidator.scala clamped values exceeding max limits instead of throwing exceptions, contradicting the updated test expectations that require rejection.

Change:

  • validIntWithRange: Changed else if (int > max) max to else if (int > max) throw ValidationException(rule)

Context:
When max limits were reduced (e.g., maxPageSize 500→100), tests were updated to expect InvalidSearchParams for over-limit values, but the implementation still silently clamped to max.

// Before: silently clamps 999999 to 100
validIntWithRange("999999", "page_size")  // returns 100

// After: throws ValidationException
validIntWithRange("999999", "page_size")  // throws "page_size must be an integer between 0 and 100"

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: moltude <1419766+moltude@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 9, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.scala-sbt.org
    • Triggering command: /usr/bin/java java -Dfile.encoding=UTF-8 -Xms1024m -Xmx1024m -Xss4M -XX:ReservedCodeCacheSize=128m -Dsbt.script=/tmp/sbt/bin/sbt -Dscala.ext.dirs=/home/REDACTED/.sbt/1.0/java9-rt-ext-eclipse_adoptium_17_0_17 -jar /tmp/sbt/bin/sbt-launch.jar testOnly *ParamValidatorTest (dns block)
  • repo.typesafe.com
    • Triggering command: /usr/bin/java java -Dfile.encoding=UTF-8 -Xms1024m -Xmx1024m -Xss4M -XX:ReservedCodeCacheSize=128m -Dsbt.script=/tmp/sbt/bin/sbt -Dscala.ext.dirs=/home/REDACTED/.sbt/1.0/java9-rt-ext-eclipse_adoptium_17_0_17 -jar /tmp/sbt/bin/sbt-launch.jar testOnly *ParamValidatorTest (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] WIP address feedback from review on API improvements Fix parameter validation to reject over-limit values instead of clamping Dec 9, 2025
Copilot AI requested a review from moltude December 9, 2025 15:15
@moltude moltude marked this pull request as ready for review December 9, 2025 15:51
@moltude moltude merged commit de04ff6 into fix/api-phase-2 Dec 9, 2025
2 checks passed
@moltude moltude deleted the copilot/sub-pr-93 branch December 9, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants