【发布时间】:2022-02-02 12:08:47
【问题描述】:
我已经在 swagger 中构建了一个 openapi 模式,其中包含一个字符串类型和格式的字段:日期时间。在示例窗口中,它显示了我
“reportingDateTime”:“2022-02-02T10:56:33.310Z”
。但是当我调用我的服务时,它会响应
“报告日期时间”:1639746778.200000000
我使用 openapi-generator-maven-plugin 版本 5.1.0 生成 spring api 类。生成的响应类有这个字段
@JsonProperty("reportingDateTime")
@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)
私有 OffsetDateTime 报告日期时间;
要获得正确的响应类型需要进行哪些更改?
【问题讨论】:
标签: java spring openapi openapi-generator