1. 스프링 검증 Validation 기능

1) Bean Validation (빈 검증기)

2) BindingResult

if (bindingResult.hasErrors()) {
    return bindingResult.allErrors
}
[
    {
        "codes": [
            "Length.loginRequestDto.password",
            "Length.password",
            "Length.java.lang.String",
            "Length"
        ],
        "arguments": [
            {
                "codes": [
                    "loginRequestDto.password",
                    "password"
                ],
                "arguments": null,
                "defaultMessage": "password",
                "code": "password"
            },
            12,
            4
        ],
        "defaultMessage": "4자 이상 12자 이하여야 합니다.",
        "objectName": "loginRequestDto",
        "field": "password",
        "rejectedValue": "",
        "bindingFailure": false,
        "code": "Length"
    },
]

3) Validation 프로젝트 예시 코드