Swagger 将下划线转换为驼峰式

Sch*_*Box 5 swagger

因此,我在使用 Swagger(Core 1.5.7)的 XML 对象定义时遇到了问题。这是我的 XML 代码:

<result status="ok">
    <another>
        <cards/>
        <customer my_super_id="2349027834"/>
        <someothers>
            <someother name="who-is-this" />
        </someothers>
    </another>
</result>
Run Code Online (Sandbox Code Playgroud)

这是我的 yml 代码:

result:
   type: object
   description: Some random description
   properties:
     status:
       type: string
       xml:
         attribute: true
     another:
       type: object
       properties:
         customer:
           type: object
           properties:
             superId:
               type: string
               xml:
                 name: my_super_id
                 attribute: true
Run Code Online (Sandbox Code Playgroud)

status我可以毫无问题地得到,但这my_super_idnull因为 Swagger 正在使用 CamelCase 中的参数生成模型类,即,mySuperId而不是my_super_id. 在我生成的模型类中,我有这个: public ResultAnotherCustomer(@JsonProperty("mySuperId") final String mySuperId)

有什么办法可以解决这个问题吗?

Sch*_*Box 2

尽管很愚蠢,但我似乎没有使用最新版本的swagger-codegen ,因此将其更新到最新版本(2.1.5)解决了问题。