Skip to content

Commit

Permalink
fix limit parameter conformance (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored Oct 20, 2023
1 parent b30ee7b commit acec45a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 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
6 changes: 3 additions & 3 deletions tests/conformance/conformance-baseline.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"passed": [
"crs.CrsRequirementClassPrecondition",
"core.apidefinition.ApiDefinition",
"core.collections.FeaturesBBox",
"core.collections.FeaturesLimit",
"core.conformance.Conformance",
"core.general.GeneralHttp",
"core.landingpage.LandingPage"
"core.landingpage.LandingPage",
"crs.CrsRequirementClassPrecondition"
],
"skipped": [
"crs.discovery.collections.DiscoveryCollectionsCrsUri",
Expand All @@ -14,7 +15,6 @@
],
"failed": [
"core.collections.Feature",
"core.collections.FeaturesLimit",
"core.collections.FeaturesTime"
]
}

0 comments on commit acec45a

Please sign in to comment.