Skip to content

feat: add ArrayContains decorator#192

Open
yuchem2 wants to merge 2 commits intodevelopfrom
CARGO-364
Open

feat: add ArrayContains decorator#192
yuchem2 wants to merge 2 commits intodevelopfrom
CARGO-364

Conversation

@yuchem2
Copy link
Member

@yuchem2 yuchem2 commented Mar 8, 2026

@ArrayContrains 데코레이터를 추가합니다.

@auto-assign auto-assign bot requested review from dami0806, laggu and sezeme March 8, 2026 12:12
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 express-cargo 라이브러리에 새로운 @ArrayContains 유효성 검사 데코레이터를 도입하여 배열 유효성 검사 기능을 확장합니다. 이 추가는 개발자가 배열 필드가 특정 필수 요소를 포함하는지 쉽게 확인할 수 있도록 하여 데이터 유효성 검사의 유연성과 견고성을 향상시킵니다. 이 변경 사항은 라이브러리의 유효성 검사 기능을 풍부하게 하고 다양한 데이터 구조에 대한 보다 정교한 유효성 검사 규칙을 가능하게 합니다.

Highlights

  • 새로운 @ArrayContains 데코레이터 추가: express-cargo 라이브러리에 배열이 지정된 모든 값을 포함하는지 검증하는 @ArrayContains 데코레이터가 추가되었습니다.
  • 다국어 문서 업데이트: 새로운 @ArrayContains 데코레이터에 대한 설명이 한국어, 영어, 독일어, 프랑스어, 러시아어 README 및 문서 파일에 추가되었습니다.
  • 사용 예시 및 테스트 추가: apps/example 프로젝트에 @ArrayContains 데코레이터의 사용 예시가 추가되었으며, 새로운 유효성 검사기에 대한 단위 테스트도 작성되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • README.ko.md
    • @ArrayContains 데코레이터에 대한 한국어 설명이 추가되었습니다.
  • README.md
    • @ArrayContains 데코레이터에 대한 영어 설명이 추가되었습니다.
  • apps/docs/docs/decorators/validators.md
    • @ArrayContains 데코레이터에 대한 문서가 추가되었습니다.
  • apps/docs/i18n/de/docusaurus-plugin-content-docs/current/decorators/validators.md
    • @ArrayContains 데코레이터에 대한 독일어 문서가 추가되었습니다.
  • apps/docs/i18n/fr/docusaurus-plugin-content-docs/current/decorators/validators.md
    • @ArrayContains 데코레이터에 대한 프랑스어 문서가 추가되었습니다.
  • apps/docs/i18n/ko/docusaurus-plugin-content-docs/current/decorators/validators.md
    • @ArrayContains 데코레이터에 대한 한국어 문서가 추가되었습니다.
  • apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/decorators/validators.md
    • @ArrayContains 데코레이터에 대한 러시아어 문서가 추가되었습니다.
  • apps/example/README.md
    • @ArrayContains 데코레이터의 사용 예시가 추가되었습니다.
  • apps/example/src/routers/validator.ts
    • ArrayContains 데코레이터가 가져와지고 이를 사용하는 예시 라우트와 클래스가 추가되었습니다.
  • packages/express-cargo/src/validator.ts
    • ArrayContains 데코레이터의 구현이 추가되었습니다.
  • packages/express-cargo/tests/validator/arrayContains.test.ts
    • ArrayContains 유효성 검사기에 대한 새로운 단위 테스트 파일이 추가되었습니다.
Activity
  • 아직 이 PR에 대한 사람의 활동은 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

새로운 @ArrayContains 데코레이터 추가 및 관련 문서와 예제를 업데이트한 풀 리퀘스트입니다. 전반적으로 구현이 잘 되었지만, ArrayContains 데코레이터의 유효성 검사 로직에서 성능을 개선할 수 있는 부분이 있습니다. 큰 배열을 처리할 때의 효율성을 높이기 위해 Set을 사용하는 것을 제안합니다. 자세한 내용은 코드 리뷰 코멘트를 참고해주세요.

@yuchem2
Copy link
Member Author

yuchem2 commented Mar 8, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR introduces a new @ArrayContains decorator, including its implementation, documentation, and examples. However, a critical vulnerability has been identified in its core validation logic. The implementation is inverted, causing it to fail for all arrays and potentially crash the server with non-iterable inputs, posing a minor stability risk (DoS via 500 errors). This bug renders the decorator unusable and requires immediate correction.

Comment on lines +461 to +462
const valueSet = new Set(value)
return values.every(v => valueSet.has(v))
Copy link
Member

Choose a reason for hiding this comment

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

이거 array element 가 object 일때도 동작하나요???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants