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

support 'allOf' and 'oneOf' in schema check #12

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ install_requires =
PyJWT>=2.0.0
pyyaml
requests
coreapi
tests_require =
pytest
pytest-django
Expand Down
2 changes: 1 addition & 1 deletion vng_api_common/inspectors/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_filter_parameters(self, filter_backend):

if fields:
queryset = self.view.get_queryset()
filter_class = filter_backend.get_filter_class(self.view, queryset)
filter_class = filter_backend.get_filterset_class(self.view, queryset)

for parameter in fields:
filter_field = filter_class.base_filters[parameter.name]
Expand Down
4 changes: 4 additions & 0 deletions vng_api_common/oas.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def obj_has_shape(obj: Union[list, dict], schema: dict, resource: str) -> bool:
if "$ref" in prop_schema:
continue

# TODO Handling allOf and oneOf not yet implemented
if "allOf" in prop_schema or "oneOf" in prop_schema:
continue

# Allow None if property is nullable
if value is None:
if prop_schema.get("nullable", False):
Expand Down