openapi: also ignores ThrowStatement

This gives an error in the resulting file, which makes it not OpenAPI
compatible (not yaml actually).

Fixes #4917

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires 2023-05-09 10:13:23 +02:00
parent 0225eefa66
commit d7243bba77

View file

@ -67,11 +67,9 @@ def get_req_body_elems(obj, elems):
get_req_body_elems(obj.right, elems) get_req_body_elems(obj.right, elems)
elif obj.type in ('ReturnStatement', 'UnaryExpression'): elif obj.type in ('ReturnStatement', 'UnaryExpression'):
get_req_body_elems(obj.argument, elems) get_req_body_elems(obj.argument, elems)
elif obj.type == 'Literal':
pass
elif obj.type == 'Identifier': elif obj.type == 'Identifier':
return obj.name return obj.name
elif obj.type == 'FunctionDeclaration': elif obj.type in ['Literal', 'FunctionDeclaration', 'ThrowStatement']:
pass pass
else: else:
print(obj) print(obj)