我从 Apache Camel
2.16.0
切换到 2.16.2
,现在即使没有指定 allowedValues
,我的所有参数都会获得一个额外的空 enum
。现在,Swagger UI 为所有数据类型显示一个空下拉列表。我认为这不应该发生,是吗?我在监督什么吗?
来自camel-example-swagger-java:
<!-- this is a rest GET to view an user by the given id -->
<get uri="/{id}" outType="org.apache.camel.example.rest.User">
<description>Find user by id</description>
<param name="id" type="path" description="The id of the user to get" dataType="integer"/>
<responseMessage message="The user that was found"/>
<responseMessage code="404" message="User not found"/>
<route>
<to uri="bean:userService?method=getUser(${header.id})"/>
<filter>
<simple>${body} == null</simple>
<setHeader headerName="Exchange.HTTP_RESPONSE_CODE">
<constant>404</constant>
</setHeader>
</filter>
</route>
</get>
这就是生成的内容,请注意空的枚举
:
"parameters" : [ {
"name" : "id",
"in" : "path",
"description" : "The id of the user to get",
"required" : true,
"type" : "integer",
"enum" : [ ]
} ],
我看到这个问题已在 2.17-SNAPSHOT 中修复,我想我将不得不等待下一个版本。
我是一名优秀的程序员,十分优秀!