summaryrefslogtreecommitdiffstats
path: root/openapi
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-05-14 10:10:21 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-05-14 10:10:21 +0200
commit1eea102f26be23c65aa6abf44373fe963acd8946 (patch)
treeedaec5675e7a5843c2ca33afc3de3e8bdf2df2f0 /openapi
parent94c1367684bc4d36e3f6874cff0b7a39e2f72560 (diff)
downloadwekan-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.py2
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