We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
public enum Provider { GENERAL, FACEBOOK, GOOGLE }
위와 같은 enum이고 아래같이 invalid한 provider값을 post함
{ "provider": "test" }
jsonParseError
@Valid
missing required value
@PostMapping("/signup") public void singup(@Valid @RequestBody UserSaveDto userSaveDto, BindResult result) { if (result.hasErrors()) { throw new BadRequestException("missing requied value"); } // do somthing.. }
@JsonCreator
@JsonCreator public static Provider create(String requestValue) { return Stream.of(values()) .filter(v -> v.toString().equalsIgnoreCase(requestValue)) .findFirst() .orElse(null) }
The text was updated successfully, but these errors were encountered:
LeoHeo
No branches or pull requests
삽질의 시작
위와 같은 enum이고 아래같이 invalid한 provider값을 post함
원인
jsonParseError
라는 에러가 나면서@Valid
를 로직을 안타서missing required value
라는 에러메세지가 response가 안된다.해결
@JsonCreator
를 추가The text was updated successfully, but these errors were encountered: