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

Validation: add context.Context to validation options #230

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

System-Glitch
Copy link
Member

@System-Glitch System-Glitch commented Oct 4, 2024

References

Issue(s): none

Description

  • Added a context.Context field to the validation.Options and validation.Context structures. If not provided, it defaults to context.Background().
  • The built-in validation middleware now uses the request context in the validation options.
    • The DB instance used in the validation options by the built-in validation middleware was already injected with the request context. Custom validators don't need to be updated.
    • Places where manual validation is used may need to be updated. However, those will continue to work exactly like they used to without changing anything.

@System-Glitch System-Glitch added the enhancement Enhancement of existing feature label Oct 4, 2024
@System-Glitch System-Glitch self-assigned this Oct 4, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11181089441

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 97.459%

Totals Coverage Status
Change from base Build 11069761312: 0.002%
Covered Lines: 6291
Relevant Lines: 6455

💛 - Coveralls

@System-Glitch System-Glitch merged commit 0fba2ef into master Oct 7, 2024
8 checks passed
@System-Glitch System-Glitch deleted the feat/validation-context branch October 7, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants