浏览代码

openapi: also consider Object type as valid

Not sure if this will end up in a correct openapi file, but the docs
are correctly generated, so... meh.
Benjamin Tissoires 5 年之前
父节点
当前提交
e1ffe943c8
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      openapi/generate_openapi.py

+ 4 - 1
openapi/generate_openapi.py

@@ -249,7 +249,10 @@ class EntryPoint(object):
 
                 if name.startswith('{'):
                     param_type = name.strip('{}')
-                    if param_type not in ['string', 'number', 'boolean', 'integer', 'array', 'file']:
+                    if param_type == 'Object':
+                        # hope for the best
+                        param_type = 'object'
+                    elif param_type not in ['string', 'number', 'boolean', 'integer', 'array', 'file']:
                         self.warn('unknown type {}\n allowed values: string, number, boolean, integer, array, file'.format(param_type))
                     try:
                         name, desc = desc.split(maxsplit=1)