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

Fixing issue #85 - resolve_schema: allOf inside allOf is ignored #92

Closed
wants to merge 3 commits into from
Closed
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 invenio_jsonschemas/jsonresolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def jsonresolver_loader(url_map):
Injected into Invenio-Records JSON resolver.
"""
from flask import current_app

from . import current_jsonschemas
url_map.add(Rule(
"{0}/<path:path>".format(current_app.config['JSONSCHEMAS_ENDPOINT']),
Expand Down
3 changes: 1 addition & 2 deletions invenio_jsonschemas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ def resolve_schema(schema):
def traverse(schema):
if isinstance(schema, dict):
if 'allOf' in schema:
for x in schema['allOf']:
for x in schema.pop('allOf'):
sub_schema = x
sub_schema.pop('title', None)
schema = _merge_dicts(schema, sub_schema)
schema.pop('allOf')
schema = traverse(schema)
elif 'properties' in schema:
for x in schema.get('properties', []):
Expand Down
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# under the terms of the MIT License; see LICENSE file for more details.

pydocstyle invenio_jsonschemas tests docs && \
isort -rc -c -df && \
isort -rc -c -df . && \
check-manifest --ignore ".travis-*" && \
sphinx-build -qnNW docs docs/_build/html && \
python setup.py test