如何用swagger解决重名错误

How to reslove the duplicate name error with swagger

我需要在带有 swagger 2.0 的对象中定义两个名为 "description" 和 "type" 的字段,下面是示例,

  description:
   type: string
   description: ''
  type:
   type: string
   description: ''

但是,抛出错误“..Duplicated mapping key...”out.Is由于指定了字段名称,有解决此错误的解决方案吗?

签入此 editor 并且此对象定义有效(基于一些示例 yaml):

newPet:
  type: object
  properties:
    id:
      type: integer
      format: int64
    description:
      type: string
      description: ''
    type:
      type: string
      description: ''