diff --git a/drf_spectacular/openapi.py b/drf_spectacular/openapi.py index 7c89c27a..186373c4 100644 --- a/drf_spectacular/openapi.py +++ b/drf_spectacular/openapi.py @@ -154,6 +154,7 @@ def _process_override_parameters(self): result[property_name, OpenApiParameter.QUERY] = build_parameter_type( name=property_name, schema=property_schema, + description=property_schema.pop('description', None), location=OpenApiParameter.QUERY, required=property_name in mapped.get('required', []), ) diff --git a/tests/test_extend_schema.yml b/tests/test_extend_schema.yml index 393577ca..22e465fb 100644 --- a/tests/test_extend_schema.yml +++ b/tests/test_extend_schema.yml @@ -216,9 +216,9 @@ paths: name: contains schema: type: string - description: filter by containing string maxLength: 10 minLength: 3 + description: filter by containing string - in: query name: nested schema: @@ -241,7 +241,7 @@ paths: type: integer maximum: 5 minimum: 1 - description: filter by rating stars + description: filter by rating stars required: true tags: - doesitall