🥅 better checks for request parameters - #349
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Client-side validation removal breaks existing test expectations/contract behavior and a few new validations/messages are inconsistent or misleading.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR tightens validation and normalization of request/search parameters across the V2 client surface, aiming to reject invalid inputs earlier and generate cleaner request parameters.
Changes:
- Added/relocated input validation for search/product parameters (e.g., trimming modelId, rejecting invalid page/perPage).
- Adjusted request-parameter serialization rules (e.g., when optional fields like
name,model_type,alias,filenameare included). - Moved inferenceId/inferenceUrl validation from
MindeeClientinto the HTTP API layer (and updated related error messages).
File summaries
| File | Description |
|---|---|
| src/main/java/com/mindee/v2/search/ragdocuments/RagDocumentSearchParameters.java | Adds stricter modelId/filename checks and trims modelId for RAG document search parameters. |
| src/main/java/com/mindee/v2/search/models/ModelSearchParameters.java | Adds stricter validation and simplifies builder/setter behavior for model search parameters. |
| src/main/java/com/mindee/v2/MindeeClient.java | Removes client-side validation for result retrieval inputs (now delegated to API impl). |
| src/main/java/com/mindee/v2/http/MindeeHttpApiV2.java | Adds validation for inferenceId and refines inferenceUrl validation error messaging. |
| src/main/java/com/mindee/v2/clientoptions/BaseSearchParameters.java | Moves page/perPage validation to constructor to fail earlier than request construction. |
| src/main/java/com/mindee/v2/clientoptions/BaseProductParameters.java | Introduces a validating base constructor (modelId/alias/webhookIds) and changes request parameter inclusion rules. |
Review details
Suppressed comments (1)
src/main/java/com/mindee/v2/http/MindeeHttpApiV2.java:157
- The validation rejects whitespace-only inferenceUrl values (trim().isEmpty()), but the exception message says "null or empty". This can confuse callers passing blanks; consider using isBlank() and updating the message accordingly.
if (inferenceUrl == null || inferenceUrl.trim().isEmpty()) {
throw new IllegalArgumentException("inferenceUrl cannot be null or empty.");
}
- Files reviewed: 6/6 changed files
- Comments generated: 7
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ianardee
force-pushed
the
better-checks
branch
from
September 3, 2026 13:54
7c29d7b to
ee03f6a
Compare
ianardee
force-pushed
the
better-checks
branch
from
September 3, 2026 13:57
ee03f6a to
45a8c49
Compare
sebastianMindee
approved these changes
Sep 3, 2026
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
Types of changes