Skip to content

Commit 0caa36f

Browse files
committed
Add an assertion before removing 'data' from variable name
1 parent b21a9c7 commit 0caa36f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fastjsonschema/generator.py

+1
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def generate_ref(self):
190190
if uri not in self._validation_functions_done:
191191
self._needed_validation_functions[uri] = name
192192
# call validation function
193+
assert self._variable_name.startswith("data")
193194
path = self._variable_name[4:]
194195
name_arg = '(name_prefix or "data") + "{}"'.format(path)
195196
self.l('{}({variable}, custom_formats, {name_arg})', name, name_arg=name_arg)

0 commit comments

Comments
 (0)