swagger-gen插件不会生成@XmlElementWrapper批注

问题描述

我在spring应用程序中使用了swagger-gen插件 以下是我的open-api规范

facility:
type: object
description: |
properties:
  name:
    type: string
    description: name of facility
    example: Facility1
  number:
    type: integer
    description: number of facility
    example: 101
  field-devices:
    type: array
    items:
      $ref: '#/deFinitions/field-device'
    xml:
      name: field-devices
      wrapped: true
    description: |
xml:
  name: facility

问题是我生成的不包含@XmlElementWrapper批注

@XmlElement(name="field-devices",required = true)
@ApiModelProperty(value = "")
@Valid
/**
* 
**/
private List<FieldDevice> fieldDevices = null;

所以我的其余xml响应是

 <facilities>
                <name>Facility 3</name>
                <number>1003</number>
                <field-devices>
                    <name>Entry 3</name>
                    <number>131</number>
                </field-devices>
                <field-devices>
                    <name>Exit 3</name>
                    <number>231</number>
                </field-devices>
                <field-devices>
                    <name>POF cashless</name>
                    <number>631</number>
                </field-devices>
            </facilities>

没有便利包装器

解决方法

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

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

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