Browse Source

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>
Benjamin Tissoires 2 năm trước cách đây
mục cha
commit
d7243bba77
1 tập tin đã thay đổi với 1 bổ sung3 xóa
  1. 1 3
      openapi/generate_openapi.py

+ 1 - 3
openapi/generate_openapi.py

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