因此,我在使用 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_id是null因为 Swagger 正在使用 CamelCase 中的参数生成模型类,即,mySuperId而不是my_super_id. 在我生成的模型类中,我有这个:
public ResultAnotherCustomer(@JsonProperty("mySuperId") final String mySuperId)
有什么办法可以解决这个问题吗?
| 归档时间: |
|
| 查看次数: |
8779 次 |
| 最近记录: |