将对象用作QueryParam时的java招摇过市注释未按预期工作
您好,我正在使用Jackson/Jersey、Swagger注释和JAX-RS参数转换器,以便能够在我的查询参数中反序列化日期:
@QueryParam("_targetDate._ge")
@Parameter(in = ParameterIn.QUERY, name = "_targetDate._ge",
required = false, allowEmptyValue = false, schema = @Schema(implementation = String.class, type = "string", format = "date"))
private Date initialTargetDate;
但是,即使我为Swagger声明该字段应该是字符串,via(Schema/implementation annotation),它也被呈现为对象而不是字符串。知道我会错过什么吗
干杯
# 1 楼答案
尝试将initialTargetDate的类型更改为String