Skip to content

Commit

Permalink
fix limit parameter conformance
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Oct 20, 2023
1 parent b30ee7b commit 020def0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/django_oapif/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ def get_paginated_response(self, data):
}
)

def get_schema_operation_parameters(self, view):
params = super().get_schema_operation_parameters(view)
for param in params:
if param["name"] in ("limit", "offset") and "style" not in param:
# The OGC conformance test requires `style: form` to be specified in the OpenAPI schema,
# even though it is the default style.
# see https://swagger.io/docs/specification/serialization/
param["style"] = "form"
return params


class HighPerfPagination(pagination.LimitOffsetPagination):
"""OAPIF-compatible django rest paginator, tailored for the high performance version where data is pre-concatenated json"""
Expand Down

0 comments on commit 020def0

Please sign in to comment.