如何使用$ ref作为openapi3中对象的属性?

时间:2020-08-04 10:51:24

标签: python openapi connexion

我正在使用connexion框架通过API进行构建。当我在Yaml文件中将$ ref用作属性名称时,openapi_spec_validator失败,并显示以下错误: 文件“ /usr/local/lib/python3.6/site-packages/jsonschema/validators.py”,第344行,按降序排列 对于self.iter_errors(实例,架构)中的错误: 文件“ /usr/local/lib/python3.6/site-packages/jsonschema/validators.py”,第328行,位于iter_errors中 错误中的错误: 文件“ /usr/local/lib/python3.6/site-packages/openapi_spec_validator/decorators.py”,第29行,已包装 如果引用self.visiting: TypeError:无法散列的类型:“ dict”。

yaml模式

id_post:
      type: object
      properties:
        id:
          type: string
       data:
          type: object
          properties:
            $ref:
              type: string
              description: URL

0 个答案:

没有答案