
Spring LocalDateTime response array로 내려올때 해결 방법공부방/Spring2023. 10. 31. 01:13
Table of Contents
어제까지만 해도 멀쩡하게 돌아가던 API가 Swagger 설정한다고,
이것저것 어노테이션 추가하다 보니.
막상 Swagger는 잘 돌아가는데 API 응답에서
LocalDateTime 값의 응답이 array로 내려오는 현상이 발견되었어요 ㅠ..
결국 App이 json값을 못 읽어 들이고, 빈 화면만 노출..
아래는 응답 값이에요.
recentAt 값이 array로 들어오는걸 확인할 수 있어요.....
{"accountProfile":{"accountId":2041,"nickname":"감자",
"profileImage":null,
"latitude":37.5356821,"longitude":127.0921144,
enable":true,"aboutMe":null,"recentAt":[2023,10,31,0,56,4]}}
자 이제 다시 Spring으로 들아가서 바로 본론으로 들어가면
아래 그림에서 파란색 선택된
요녀석 때문이에요.
@EnableWebFlux
이 녀석을 설정하면 Spring boot의 자동 구성이 비활성화가 되어서 그런다고 해요.
저는 사용할 필요가 없어서 지웠지만, 만약 필요하다면 아래 고수님들의 도움을 받아서 수정해 보도록 하세요 ㅎ.
Why does Jackson destructure my LocalDateTime when I add a CorsMapping configuration in Spring?
I have a simple API which handles Entity objects (shown below). @Data public class Entity { private LocalDateTime createdAt; } A controller which looks like the following: @RestController @
stackoverflow.com
반응형
'공부방 > Spring' 카테고리의 다른 글
Spring google SMTP settings (1) | 2023.10.29 |
---|---|
Spring boot swagger 설정시 주의 사항 (0) | 2023.10.29 |
How to install h2 in mac os (맥에서 h2 설치하기) (0) | 2023.02.12 |
@soycrab :: 꿀맛코딩
행복한 코딩을 위하여!
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!