🐛 search params must be typed to response - #441
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The typed BaseSearchParameters<TSearchResponse> change is a public API breaking change (needs compatibility strategy or release documentation alignment) and the new generic constraint should be adjusted.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR strengthens the V2 Search API by tying search-parameter types to their corresponding search-response types at compile time, and also standardizes test categorization by adding a common V1 test trait across many unit tests.
Changes:
- Make
BaseSearchParametersgeneric and updateClient.SearchAsync/ HTTP layer signatures to acceptBaseSearchParameters<TSearchResponse>. - Update V2 search parameter classes (
ModelSearchParameters,RagDocumentSearchParameters) to inherit from the typed base. - Add
[Trait("Category","V1")]to many V1 unit tests, plus minor cleanup (unused usings, workflow name, doc comment).
File summaries
| File | Description |
|---|---|
| tests/Mindee.UnitTests/V1/Product/Us/PayrollCheckRegister/PayrollCheckRegisterV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Us/BankCheck/BankCheckV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Receipt/ReceiptV5Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Receipt/ReceiptV4Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Passport/PassportV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/InvoiceSplitter/InvoiceSplitterV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Invoice/InvoiceV4Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/InternationalId/InternationalIdV2Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Generated/GeneratedV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Fr/Payslip/PayslipV3Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Fr/IdCard/IdCardV2Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Fr/IdCard/IdCardV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Fr/HealthCard/HealthCardV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Fr/CarteGrise/CarteGriseV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/FinancialDocument/FinancialDocumentV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/Cropper/CropperV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Product/BarcodeReader/BarcodeReaderV1Test.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Parsing/Standard/DecimalFieldTest.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Parsing/Standard/DateFieldTest.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Parsing/LocalResponseTest.cs | Add V1 trait and rename category. |
| tests/Mindee.UnitTests/V1/Parsing/Common/OcrTest.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Parsing/Common/FullTextOcrTest.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Parsing/Common/ErrorTest.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Parsing/Common/CropperTest.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Parsing/Common/AsyncPredictResponseTest.cs | Add V1 test category trait. |
| tests/Mindee.UnitTests/V1/Http/MindeeApiTest.cs | Remove unused using. |
| tests/Mindee.UnitTests/V1/ClientTest.cs | Remove unused using. |
| tests/Mindee.IntegrationTests/V2/Search/ModelSearchTest.cs | Let SearchAsync infer TSearchResponse from typed parameters. |
| src/Mindee/V2/Search/RagDocuments/RagDocumentSearchParameters.cs | Type search params to RagDocumentSearchResponse and update XML docs. |
| src/Mindee/V2/Search/Models/ModelSearchParameters.cs | Type search params to ModelSearchResponse and update XML docs. |
| src/Mindee/V2/Product/Extraction/RagDocuments/Params/RagDocumentUploadParameters.cs | Remove empty XML <returns> tag. |
| src/Mindee/V2/Http/MindeeApiV2.cs | Update search request signature to typed BaseSearchParameters<TSearchResponse>. |
| src/Mindee/V2/Http/HttpApiV2.cs | Update abstract search request signature + XML docs for typed parameters. |
| src/Mindee/V2/ClientOptions/BaseSearchParameters.cs | Make base search parameters generic and constrain to search response type. |
| src/Mindee/V2/Client.cs | Update SearchAsync signature to accept typed search parameters. |
| .github/workflows/cron.yml | Rename workflow display name. |
Review details
- Files reviewed: 38/39 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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