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

custom validation tags with constraints specified in the spec. #487

Open
nguyen0096 opened this issue Jun 24, 2024 · 0 comments
Open

custom validation tags with constraints specified in the spec. #487

nguyen0096 opened this issue Jun 24, 2024 · 0 comments

Comments

@nguyen0096
Copy link

Currently, for example, I put tag maxLength:"3", Huma will validate to input Body and also put a text in spec to indicate the constraint.

image

I can add validation logic with Resolve method but is there anyway that I can:

  • Pre-configure the validation logic and just adding tag to model, instead of defining Resolve method for all input models.
  • Put another text in the position of <= 3 characters as in the image, instead of putting it into description.

Thanks! You guys created a great repository btw.

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

No branches or pull requests

1 participant