解决JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String
在项目中我们会使用新的时间类LocalDateTime问题:在使用Postman测试Spring Boot项目接口时,接口返回JSON parse error: Cannot deserialize value of type java.time.LocalDateTime from String错误解决办法:需要在你使用LocalDateTime的属性加上@JsonFormat(shape =
·
在项目中我们会使用新的时间类LocalDateTime
问题:
在使用Postman测试Spring Boot项目接口时,接口返回JSON parse error: Cannot deserialize value of type java.time.LocalDateTime
from String错误
解决办法:
需要在你使用LocalDateTime的属性加上
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
重启项目即可!!!
更多推荐
所有评论(0)