diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-05-14 10:10:21 +0200 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-05-14 10:10:21 +0200 |
commit | 1eea102f26be23c65aa6abf44373fe963acd8946 (patch) | |
tree | edaec5675e7a5843c2ca33afc3de3e8bdf2df2f0 /openapi | |
parent | 94c1367684bc4d36e3f6874cff0b7a39e2f72560 (diff) | |
download | wekan-1eea102f26be23c65aa6abf44373fe963acd8946.tar.gz wekan-1eea102f26be23c65aa6abf44373fe963acd8946.tar.bz2 wekan-1eea102f26be23c65aa6abf44373fe963acd8946.zip |
openAPI: also handle `export` statement in the scripts
The files are actually modules, not plain scripts, and thus we are allowed
to use `export`. Without `parseModule`, the script would silently fail
when parsing `export.js` and the export function will not be present.
Diffstat (limited to 'openapi')
-rw-r--r-- | openapi/generate_openapi.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openapi/generate_openapi.py b/openapi/generate_openapi.py index 2a898f0e..1bf04c15 100644 --- a/openapi/generate_openapi.py +++ b/openapi/generate_openapi.py @@ -678,7 +678,7 @@ def parse_schemas(schemas_dir): data = ''.join(f.readlines()) try: # if the file failed, it's likely it doesn't contain a schema - program = esprima.parseScript(data, options={'comment': True, 'loc': True}) + program = esprima.parseModule(data, options={'comment': True, 'loc': True}) except: continue |