Fix openapi docs generation

esprima-python is now safe to use
(https://github.com/Kronuz/esprima-python/pull/12)

And there was a new ArrowFunctionExpression used in db666eec65
that broke the python script
This commit is contained in:
Benjamin Tissoires 2021-03-26 18:41:34 +01:00
parent be22ca332b
commit 2c1f40357d
4 changed files with 21512 additions and 6 deletions

View file

@ -1,6 +1,7 @@
#!/bin/env python3
import argparse
import esprima
import json
import logging
import os
@ -14,7 +15,7 @@ err_context = 3
def get_req_body_elems(obj, elems):
if obj.type == 'FunctionExpression':
if obj.type in ['FunctionExpression', 'ArrowFunctionExpression']:
get_req_body_elems(obj.body, elems)
elif obj.type == 'BlockStatement':
for s in obj.body: