Skip to content

[feature] 지원서 수정 요청시에 설명필드가 비어있는지 검증을 한다#1216

Merged
lepitaaar merged 3 commits intodevelop/befrom
feature/#1215-add-validation-application-description-field-MOA-664
Feb 23, 2026
Merged

[feature] 지원서 수정 요청시에 설명필드가 비어있는지 검증을 한다#1216
lepitaaar merged 3 commits intodevelop/befrom
feature/#1215-add-validation-application-description-field-MOA-664

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Feb 19, 2026

#️⃣연관된 이슈

📝작업 내용

지원서 수정시 요청에 누락되었던 검증필드를 추가하였습니다

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능
    • 클럽 신청 양식의 제목 필드 필수 입력 검증 추가
    • 내부 양식 모드에서 설명 및 질문 항목의 필수 입력 검증 추가
    • 외부 양식 모드에서 신청 URL의 필수 입력 검증 추가

@lepitaaar lepitaaar self-assigned this Feb 19, 2026
@lepitaaar lepitaaar added ✨ Feature 기능 개발 💾 BE Backend labels Feb 19, 2026
@vercel
Copy link

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moadong Ready Ready Preview, Comment Feb 21, 2026 6:51am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review. 🎉


Walkthrough

클럽 신청 양식 요청 DTO에 필드 검증 기능을 추가하였습니다. title 필드에 @NotBlank 어노테이션을 적용하고, 양식 모드(내부/외부)별 유효성 검사를 수행하는 두 개의 비공개 검증 메서드를 구현했습니다.

Changes

Cohort / File(s) Summary
검증 로직 추가
backend/src/main/java/moadong/club/payload/request/ClubApplicationFormEditRequest.java
title 필드에 @NotBlank 어노테이션 추가, 내부 양식(isInternalFormValid())과 외부 양식(isExternalFormValid()) 유효성 검증 메서드 구현

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • Zepelown
  • SeongHoonC
  • oesnuj
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 내용을 명확하게 설명하고 있습니다. 지원서 수정 요청 시 설명 필드 검증 추가라는 핵심 변화가 잘 드러나 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#1215-add-validation-application-description-field-MOA-664

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 19, 2026

Test Results

99 tests   99 ✅  17s ⏱️
23 suites   0 💤
23 files     0 ❌

Results for commit d003809.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/src/main/java/moadong/club/payload/request/ClubApplicationFormEditRequest.java (1)

25-25: ⚠️ Potential issue | 🟡 Minor

formModenull이면 두 검증 메서드가 모두 무조건 통과합니다.

formMode 필드에 @NotNull이 없기 때문에, null 값이 전달되면 두 != 가드가 모두 true를 반환해 cross-field 검증 전체가 우회됩니다. formMode가 필수 필드라면 @NotNull을 추가해야 합니다.

🛡️ 제안 수정
+        `@NotNull`
         ApplicationFormMode formMode,

Also applies to: 36-38, 48-50

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@backend/src/main/java/moadong/club/payload/request/ClubApplicationFormEditRequest.java`
at line 25, The formMode field in ClubApplicationFormEditRequest allows null so
the cross-field guards that compare against formMode (the two validation methods
referenced) can be bypassed; add `@NotNull` to the formMode field declaration in
ClubApplicationFormEditRequest (and the same change in the other affected
request classes/fields at the other locations) and import
javax.validation.constraints.NotNull so that null values are rejected before the
cross-field validation logic runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@backend/src/main/java/moadong/club/payload/request/ClubApplicationFormEditRequest.java`:
- Around line 34-53: Change the two private validation methods
isInternalFormValid() and isExternalFormValid() to public so they follow
JavaBeans conventions and avoid DataBinder NotReadablePropertyException during
validation; update the access modifier in ClubApplicationFormEditRequest for
both methods (and make the same change in ClubApplicationFormCreateRequest for
the equivalent methods) so Spring's validator can access the boolean properties
without causing 500 errors.

---

Outside diff comments:
In
`@backend/src/main/java/moadong/club/payload/request/ClubApplicationFormEditRequest.java`:
- Line 25: The formMode field in ClubApplicationFormEditRequest allows null so
the cross-field guards that compare against formMode (the two validation methods
referenced) can be bypassed; add `@NotNull` to the formMode field declaration in
ClubApplicationFormEditRequest (and the same change in the other affected
request classes/fields at the other locations) and import
javax.validation.constraints.NotNull so that null values are rejected before the
cross-field validation logic runs.

Comment on lines +34 to +53
@AssertTrue(message = "지원서 양식에 필요한 필드가 누락되었습니다.")
private boolean isInternalFormValid() {
if (formMode != ApplicationFormMode.INTERNAL) {
return true;
}

boolean hasDescription = StringUtils.hasText(description);
boolean hasQuestions = questions != null && !questions.isEmpty();

return hasDescription && hasQuestions;
}

@AssertTrue(message = "외부 링크가 누락되었습니다.")
private boolean isExternalFormValid() {
if (formMode != ApplicationFormMode.EXTERNAL) {
return true;
}

return StringUtils.hasText(externalApplicationUrl);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the actual file to confirm the code snippet
cat -n backend/src/main/java/moadong/club/payload/request/ClubApplicationFormEditRequest.java | head -60

Repository: Moadong/moadong

Length of output: 1760


🏁 Script executed:

# Search for other `@AssertTrue` usage in the codebase to understand patterns
rg -n --type java '@AssertTrue' -A 2 -B 1

Repository: Moadong/moadong

Length of output: 2125


🏁 Script executed:

# Check if there are any other validation constraint methods (private or public) in the codebase
rg -n --type java '(private|public)\s+boolean\s+is[A-Z]' -A 1 | head -50

Repository: Moadong/moadong

Length of output: 2973


🌐 Web query:

Spring DataBinder @AssertTrue private method NotReadablePropertyException validation

💡 Result:

In Spring MVC / DataBinder-triggered Bean Validation (@Valid on a form/model attribute), Hibernate Validator validates bean properties (fields or JavaBeans getters). If you put @AssertTrue on a private helper method that is not a JavaBeans getter, Spring/HV won’t treat it as a constraint to execute; instead you can end up with Spring trying to resolve it as a property and failing with NotReadablePropertyException (no readable getter for that “property”). (stackoverflow.com)

Fixes

  1. Make it a real JavaBeans boolean getter and annotate that

    `@AssertTrue`(message = "...")
    public boolean isValid() { ... }   // no args; name starts with is/get

    This is the standard way for cross-field checks with @AssertTrue in bean validation. (stackoverflow.com)

  2. Or annotate a field instead of a method

    `@AssertTrue`(message="...")
    private boolean valid;
    public boolean isValid() { return valid; }

    (Field constraints don’t depend on getter naming; the validator can access fields directly.) (docs.hibernate.org)

  3. If you truly want “method validation” (arbitrary methods), don’t use DataBinder for that
    Use executable/method validation (e.g., Spring’s @Validated on service methods). DataBinder validation is about validating the bound bean, not invoking arbitrary private methods. (docs.spring.io)

Citations:


🌐 Web query:

Bean Validation @AssertTrue property constraint public getter requirement specification

💡 Result:

In Bean Validation, a property constraint such as @AssertTrue may be placed on a JavaBeans getter (i.e., the read accessor). The specification’s requirements are:

  • The constrained property accessor must follow JavaBeans getter conventions: getX() (no parameters) or, for boolean properties, isX() (no parameters, returns boolean). The property name is derived via java.beans.Introspector.decapitalize(...). [1]
  • Visibility is not constrained by the specification: “The fields or methods visibility are not constrained.” So a constrained getter is not required to be public by the Bean Validation spec (though some frameworks/contexts may impose additional rules outside the spec). [1]
  • Static fields and static methods are excluded from validation. [2]

Sources:
[1] Bean Validation spec, “Field and property validation” (JavaBeans conventions + visibility not constrained) https://beanvalidation.org/latest-draft/spec/
[2] Bean Validation spec, “Requirements on classes to be validated” (static excluded) https://beanvalidation.org/latest-draft/spec/


private 접근자의 @AssertTrue 메서드는 Spring의 데이터 바인더에서 유효성 검증 실패 시 문제를 유발할 수 있습니다.

Bean Validation 사양은 제약 조건을 private 메서드에 적용하는 것을 금지하지 않지만, Spring MVC의 DataBinder는 유효성 검증 실패 시 JavaBeans 규약에 따라 프로퍼티를 조회하려 시도합니다. 이 경우 internalFormValid, externalFormValid 프로퍼티가 접근 불가능하면 NotReadablePropertyException을 발생시켜 400 오류 대신 500 오류를 반환할 수 있습니다.

접근 제어자를 public으로 변경하여 JavaBeans 컨벤션을 준수하면 이 문제가 해결되며, 코드의 의도도 명확해집니다.

제안 수정
-    `@AssertTrue`(message = "지원서 양식에 필요한 필드가 누락되었습니다.")
-    private boolean isInternalFormValid() {
+    `@AssertTrue`(message = "지원서 양식에 필요한 필드가 누락되었습니다.")
+    public boolean isInternalFormValid() {

-    `@AssertTrue`(message = "외부 링크가 누락되었습니다.")
-    private boolean isExternalFormValid() {
+    `@AssertTrue`(message = "외부 링크가 누락되었습니다.")
+    public boolean isExternalFormValid() {

참고: 동일한 패턴이 ClubApplicationFormCreateRequest.java에도 존재하므로 함께 수정이 필요합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@backend/src/main/java/moadong/club/payload/request/ClubApplicationFormEditRequest.java`
around lines 34 - 53, Change the two private validation methods
isInternalFormValid() and isExternalFormValid() to public so they follow
JavaBeans conventions and avoid DataBinder NotReadablePropertyException during
validation; update the access modifier in ClubApplicationFormEditRequest for
both methods (and make the same change in ClubApplicationFormCreateRequest for
the equivalent methods) so Spring's validator can access the boolean properties
without causing 500 errors.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@backend/src/main/java/moadong/club/payload/request/ClubApplicationFormCreateRequest.java`:
- Around line 16-18: The `@NotBlank` on the description field causes an unwanted
mandatory constraint in EXTERNAL mode; decide which behavior you want and
implement accordingly: either A) keep `@NotBlank` on String description and remove
the redundant hasDescription check from isInternalFormValid(), or B) remove the
field-level `@NotBlank` so description is optional like questions and validate
presence only inside isInternalFormValid(); update the class
ClubApplicationFormCreateRequest and its methods isInternalFormValid() /
isExternalFormValid() to reflect the chosen option consistently.

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

설명 필드 검증을 추가해주셨네요 굳

@lepitaaar lepitaaar merged commit aff80a1 into develop/be Feb 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💾 BE Backend ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants