Skip to content

fix: functional response validation failure#246

Merged
PENEKhun merged 2 commits intodevelopfrom
fix/gh-245
Oct 6, 2025
Merged

fix: functional response validation failure#246
PENEKhun merged 2 commits intodevelopfrom
fix/gh-245

Conversation

@PENEKhun
Copy link
Copy Markdown
Member

@PENEKhun PENEKhun commented Sep 26, 2025

related #245


fix functional response valdiate not working

@PENEKhun PENEKhun self-assigned this Sep 26, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Sep 26, 2025

Warning

Rate limit exceeded

@PENEKhun has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fe7d3a2 and d91433c.

📒 Files selected for processing (1)
  • lib/dsl/test-builders/validateResponse.ts (4 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/gh-245

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.

@PENEKhun PENEKhun added the bug bugbugbug label Sep 26, 2025
@PENEKhun PENEKhun marked this pull request as ready for review October 5, 2025 11:17
Copy link
Copy Markdown
Collaborator

@wnghdcjfe wnghdcjfe left a comment

Choose a reason for hiding this comment

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

I built and tested the test code based on the function, and it works well.
image

ex) testcode

        itDoc("회원 목록을 조회한다.", async () => {
            await apiDoc
              .test()
              .req()
              .queryParam({
                page: field("페이지", 1),
                size: field("페이지 사이즈", 3),
              })
              .res()
              .status(HttpStatus.OK)
              .body({
                page: field("페이지 번호", (val) => {
                  if (typeof val !== "number") throw new Error("page must be a number");
                  if (val < 1) throw new Error("page must be >= 1");
                  return val;
                }),
                size: field("페이지 사이즈", (val) => {
                  if (typeof val !== "number") throw new Error("size must be a number");
                  if (val < 1) throw new Error("size must be >= 1");
                  return val;
                }),
                total: field("전체 회원 수", (val) => {
                  if (typeof val !== "number") throw new Error("total must be a number");
                  if (val < 0) throw new Error("total must be >= 0");
                  return val;
                }),
                members: field("회원 목록", (arr) => {
                  if (!Array.isArray(arr)) throw new Error("members must be an array");
                  arr.forEach((m, i) => {
                    if (typeof m !== "object" || m == null) throw new Error(`members[${i}] must be object`);
                    if (typeof m.username !== "number") throw new Error(`members[${i}].username must be string`);
                    if (typeof m.name !== "number") throw new Error(`members[${i}].name must be string`);
                  });
                  return arr;
                }),
              });
          });

Thank you for your hard work.
I think It just need to change the English comment section. I think @json-choi did PR to change all Korean annotations into English annotations in the past, but there are a few things he missed.

I've left all the other English comments in the review, and you just need to add this part.

145line
원시 타입인 경우 직접 비교 -> If primitive types, compare directly

@PENEKhun
Copy link
Copy Markdown
Member Author

PENEKhun commented Oct 6, 2025

I built and tested the test code based on the function, and it works well. image

Thank you for your hard work. I think It just need to change the English comment section. I think @json-choi did PR to change all Korean annotations into English annotations in the past, but there are a few things he missed.

  • 145line
    원시 타입인 경우 직접 비교 -> If primitive types, compare directly

I will translate all languages in the examples with another PR.

@PENEKhun PENEKhun merged commit 30b9065 into develop Oct 6, 2025
2 checks passed
@PENEKhun PENEKhun deleted the fix/gh-245 branch October 6, 2025 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug bugbugbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants