From bcddec62835d5fdc43fe34d9cfb85de935b32ef4 Mon Sep 17 00:00:00 2001 From: "andrii.stanishevskyi" Date: Fri, 2 Sep 2022 23:26:17 +0300 Subject: [PATCH] [fix] Added missing float type to InBBoxFilter schema --- rest_framework_gis/filters.py | 4 ++-- .../django_restframework_gis_tests/test_schema_generation.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rest_framework_gis/filters.py b/rest_framework_gis/filters.py index 018241a4..cb514d33 100644 --- a/rest_framework_gis/filters.py +++ b/rest_framework_gis/filters.py @@ -91,7 +91,7 @@ def get_schema_operation_parameters(self, view): "description": "Specify a bounding box as filter: in_bbox=min_lon,min_lat,max_lon,max_lat", "schema": { "type": "array", - "items": {"type": "float"}, + "items": {"type": "number", "format": "float"}, "minItems": 4, "maxItems": 4, "example": [0, 0, 10, 10], @@ -257,7 +257,7 @@ def get_schema_operation_parameters(self, view): "Represents **point** in **Distance to point filter**", "schema": { "type": "array", - "items": {"type": "float"}, + "items": {"type": "number", "format": "float"}, "minItems": 2, "maxItems": 2, "example": [0, 10], diff --git a/tests/django_restframework_gis_tests/test_schema_generation.py b/tests/django_restframework_gis_tests/test_schema_generation.py index b9c45b5d..506adae0 100644 --- a/tests/django_restframework_gis_tests/test_schema_generation.py +++ b/tests/django_restframework_gis_tests/test_schema_generation.py @@ -541,7 +541,7 @@ def test_in_BBox_filter_schema(self): "description": "Specify a bounding box as filter: in_bbox=min_lon,min_lat,max_lon,max_lat", "schema": { "type": "array", - "items": {"type": "float"}, + "items": {"type": "number", "format": "float"}, "minItems": 4, "maxItems": 4, "example": [0, 0, 10, 10], @@ -599,7 +599,7 @@ def test_distance_to_point_filter(self): "Represents **point** in **Distance to point filter**", "schema": { "type": "array", - "items": {"type": "float"}, + "items": {"type": "number", "format": "float"}, "minItems": 2, "maxItems": 2, "example": [0, 10],