Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the BBOX filter creates invalid Open API Schema #291

Open
tomdtp opened this issue Nov 23, 2023 · 0 comments
Open

Using the BBOX filter creates invalid Open API Schema #291

tomdtp opened this issue Nov 23, 2023 · 0 comments

Comments

@tomdtp
Copy link

tomdtp commented Nov 23, 2023

I have an API view using a BBOX filter:

class ProtectedAreaGeoJSONViewSet(ListAPIView):
    schema = AutoSchema(operation_id_base="ProtectedAreaGeoJSON")

    queryset = Geodata.objects.all()
    bbox_filter_field = "geometry"
    filter_backends = (InBBoxFilter,)

This leads to the generation of this OpenAPI Schema entry:

      - name: in_bbox
        required: false
        in: query
        description: 'Specify a bounding box as filter: in_bbox=min_lon,min_lat,max_lon,max_lat'
        schema:
          type: array
          items:
            type: float
          minItems: 4
          maxItems: 4
          example:
          - 0
          - 0
          - 10
          - 10
        style: form
        explode: false

Which is incorrect, as the type of the array entries should be number and not float.

Any ideas why this is happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant