diff --git a/drf_spectacular/plumbing.py b/drf_spectacular/plumbing.py index cf50eb4d..2f721250 100644 --- a/drf_spectacular/plumbing.py +++ b/drf_spectacular/plumbing.py @@ -1280,6 +1280,7 @@ def build_mock_request(method, path, view, original_request, **kwargs): def set_query_parameters(url, **kwargs) -> str: """ deconstruct url, safely attach query parameters in kwargs, and serialize again """ + url = str(url) # Force evaluation of reverse_lazy urls scheme, netloc, path, params, query, fragment = urllib.parse.urlparse(url) query = urllib.parse.parse_qs(query) query.update({k: v for k, v in kwargs.items() if v is not None})