Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

카카오 API 응답값을 response dto로 변환하는 과정에서 UnrecognizedPropertyException이 발생하는 문제 #103

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class JwtTokenInfoResponse {
@Schema(description = "Token value", example = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwicm9sZSI6IlJPTEVfVVNFUiIsImxvZ2luVHlwZSI6IktBS0FPIiwiaWF0IjoxNjc3NDg0NzExLCJleHAiOjE2Nzc1Mjc5MTF9.eM2R_mMRqkPUsMmJN_vm2lAsIGownPJZ6Xu47K6ujrI")
private String token;

@Schema(description = "Token 만료 시각", example = "2023-02-28T17:13:55.473")
@Schema(description = "Token 만료 시각")
private LocalDateTime expiresAt;

public static JwtTokenInfoResponse from(JwtTokenInfoDto jwtTokenInfoDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import org.springframework.lang.Nullable;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@JsonIgnoreProperties(ignoreUnknown = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public record KakaoUserInfoResponse(
String id,
@JsonProperty("kakao_account") KakaoAccount kakaoAccount
) {

@JsonIgnoreProperties(ignoreUnknown = true)
public record KakaoAccount(
@JsonProperty("profile_image_needs_agreement") Boolean profileImageNeedsAgreement,
Profile profile,
Expand All @@ -38,6 +41,7 @@ public record KakaoAccount(
String gender
) {

@JsonIgnoreProperties(ignoreUnknown = true)
public record Profile(
@JsonProperty("profile_image_url") String profileImageUrl,
@JsonProperty("thumbnail_image_url") String thumbnailImageUrl,
Expand Down
Loading