我有这个开放的 API 注释
@GET
@Operation(method = "Get orders", description = "GetOrdersRoute",
parameters = {
@Parameter(in = ParameterIn.QUERY, name = "batchSize", required = true,
schema = @Schema(type = "")),
@Parameter(in = ParameterIn.QUERY, name = "fromDate", required = true),
@Parameter(in = ParameterIn.QUERY, name = "filter", required = true)},
responses = {
@ApiResponse(description = "The order",
content = @Content(mediaType = "application/json",
schema = @Schema(implementation = OrderDto.class)))})
@Override
public String handle(@Parameter(hidden = true) Request request, @Parameter(hidden = true) Response response) {
return api.exec();
}
有用。但是当我添加到@Parameter
任何@Schema
值时,schema = @Schema(type = "integer"))
我得到一个例外:
java.lang.NoSuchMethodError: org.apache.commons.lang3.math.NumberUtils.isCreatable(Ljava/lang/String;)Z
换句话说: @Schema(type = ""))
工作正常但 @Schema(type = "integer"))
不起作用。
不仅是注释中type
的参数。@Schema
注释中的任何覆盖参数都会 @Schema
引发此异常。
但是@Schema
in@ApiResponse
可以与任何覆盖参数一起正常工作。