Skip to content

Commit

Permalink
fix bug handling /**/key/*
Browse files Browse the repository at this point in the history
  • Loading branch information
lnoor committed Apr 24, 2022
1 parent bf3a295 commit 5727d04
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions docs/directive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ hide_key_if_empty: (default: None)
encoding (default: None)
Allows you to define the encoding used by the file containing the json schema.

pass_unmodified (default: None)
Allows you to prevent escaping of _, / and * characters in strings.

Lift Title
++++++++++

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='sphinx-jsonschema',
version='1.18.0', # don't forget: must match __init__.py::setup() return value
version='1.18.1', # don't forget: must match __init__.py::setup() return value

description='Sphinx extension to display JSON Schema',
long_description=long_description,
Expand Down
11 changes: 5 additions & 6 deletions sphinx-jsonschema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@ def deeper(v):
if deep:
_json_fan_out(v, path, transform, deep)
else:
sub_path = path[1:]
if len(sub_path) :
_json_bind(v, sub_path, transform)
if len(path) > 1 :
_json_bind(v, path[1:], transform)

def iterate(iterator):
for k, v in iterator:
if k == path[0]:
targets.append(k)
targets.append(path)
else:
deeper(v)

Expand All @@ -87,7 +86,7 @@ def iterate(iterator):
# Since transformers can mutate the original document
# we need to process them once we're done iterating
for r in targets:
transform(doc, r)
_json_bind(doc, r, transform)


def _json_bind(doc, path, transform):
Expand Down Expand Up @@ -353,5 +352,5 @@ def setup(app):
app.add_config_value('jsonschema_options', {}, 'env')
return {
'parallel_read_safe': True,
'version': '1.18.0'
'version': '1.18.1'
}

0 comments on commit 5727d04

Please sign in to comment.