definition.WhitelistRule.properties.rule_details.properties.oneOf 应该是 Swagger Editor 中的对象

问题描述

我目前正在使用 http://editor.swagger.io 编辑器来帮助为我们的 API 添加一些新端点。我正在为这个项目使用 Openapi 2.0。该问题出现在定义中的以下块中:

  WhitelistRule:
    properties:
      rule_type:
        properties:
          ruletype_id:
            type: integer
          ruletype_description:
            type: string
            description: rule type description
      rule_details:
        type: object
        properties:
          oneOf:
            - $ref: '#/deFinitions/Detail1'
            - $ref: '#/deFinitions/Detail2'
            - $ref: '#/deFinitions/Detail3'

根据编辑器,第一个$ref被标记should be object

我意识到 Openapi2.0 不支持 oneOf 但是我不知道如何继续解决这个问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)