-
Notifications
You must be signed in to change notification settings - Fork 306
Description
Problem
When using custom filters that perform search across multiple fields (e.g., a search parameter that queries several fields but doesn’t correspond directly to a single model field), drf-spectacular raises warnings during schema generation:
Warning: Exception raised while trying resolve model field for django-filter field "search". Defaulting to string (Exception: 'search')
Currently, there is no built-in way to explicitly tell drf-spectacular that a filter parameter is not tied to a specific model field, but rather a virtual or multi-field search. This results in noisy warnings or inaccurate schema generation.
Request
Add a supported mechanism or option in drf-spectacular to declare that a filter parameter is a “virtual” or “multi-field” search, allowing:
- Suppression of misleading warnings.
- Correct schema documentation of the parameter.
- Better integration with custom filter backends like multi-field or translated search filters.
This would greatly improve usability for projects implementing complex search filters.