Skip to content
New issue

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

是否支持List类型校验 #35

Open
iFoxox opened this issue Sep 20, 2024 · 1 comment
Open

是否支持List类型校验 #35

iFoxox opened this issue Sep 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@iFoxox
Copy link

iFoxox commented Sep 20, 2024

我记得以前的校验框架如果要对List内的对象进行校验是要自己扩展的,不知道这个组件是否支持。因为没有看到示例这方面的代码

@stick-i
Copy link
Owner

stick-i commented Sep 20, 2024

组件目前没有对List类型提供校验的逻辑,但有以下方式可以实现目标:

  • 如果是要判断List当中的每个对象是否为Null,可以通过 @SpelAssert 调用静态方法来实现。
  • 如果是要获取List当中的某一个对象,可以通过SpEL获取。

之后可能会让一些注解支持对List的校验,我认为这是合理的,但它的优先级不是特别高。如果你有兴趣,可以尝试着做这件事情,我是非常欢迎的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Ready
Development

No branches or pull requests

2 participants