Summary
When the keywords search parameter was replaced by controlled_keywords in #702, a model_validator was added to ExperimentsSearch (in src/mavedb/view_models/search.py) to surface a clear error message to consumers still sending the old field.
Proposed Behavior
Remove the reject_deprecated_keywords model_validator from both ExperimentsSearch and ScoreSetsSearch. Requests that include a keywords field in the search body should result in a standard Pydantic validation error (extra field rejected) rather than the custom deprecation message.
Acceptance Criteria
- The
reject_deprecated_keywords validator is removed from ExperimentsSearch in src/mavedb/view_models/search.py.
- If
model_validator is no longer used anywhere in search.py after the removal, its import is also cleaned up.
- Any tests that assert the specific deprecation error message for the
keywords field are removed or updated to reflect standard Pydantic extra-field rejection behavior.
- Existing tests for valid
controlled_keywords payloads continue to pass.
Implementation Notes
- The validator to remove is
reject_deprecated_keywords decorated with @model_validator(mode="before") on both ExperimentsSearch.
Summary
When the
keywordssearch parameter was replaced bycontrolled_keywordsin #702, amodel_validatorwas added toExperimentsSearch(insrc/mavedb/view_models/search.py) to surface a clear error message to consumers still sending the old field.Proposed Behavior
Remove the
reject_deprecated_keywordsmodel_validatorfrom bothExperimentsSearchandScoreSetsSearch. Requests that include akeywordsfield in the search body should result in a standard Pydantic validation error (extra field rejected) rather than the custom deprecation message.Acceptance Criteria
reject_deprecated_keywordsvalidator is removed fromExperimentsSearchinsrc/mavedb/view_models/search.py.model_validatoris no longer used anywhere insearch.pyafter the removal, its import is also cleaned up.keywordsfield are removed or updated to reflect standard Pydantic extra-field rejection behavior.controlled_keywordspayloads continue to pass.Implementation Notes
reject_deprecated_keywordsdecorated with@model_validator(mode="before")on bothExperimentsSearch.