Merge pull request #3889 from bentiss/fix-openapi

openapi: actually catch the error when esprima fails at parsing the file
This commit is contained in:
Lauri Ojansivu 2021-07-01 14:07:11 +03:00 committed by GitHub
commit 4c29b72242
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -821,6 +821,11 @@ def parse_schemas(schemas_dir):
for filename in files:
path = os.path.join(root, filename)
context = parse_file(path)
if context is None:
# the file doesn't contain a schema (see above)
continue
program = context.program
current_schema = None