Skip to content

feat(context): add ValidateCtx - #3152

Open
shblue21 wants to merge 2 commits into
labstack:masterfrom
shblue21:feat/context-validation
Open

shblue21 wants to merge 2 commits into
labstack:masterfrom
shblue21:feat/context-validation

Conversation

@shblue21

@shblue21 shblue21 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

This adds c.ValidateCtx(v) to pass the request context to the validator, as discussed in #2399. If the validator doesn't implement ValidateCtx, it calls Validate instead.

I left c.Validate(v) unchanged. Making it call ValidateCtx automatically could skip a wrapper's own validation when it embeds another validator with that method.

@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.80%. Comparing base (dcb05f0) to head (755c804).
⚠️ Report is 31 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3152      +/-   ##
==========================================
+ Coverage   93.34%   95.80%   +2.45%     
==========================================
  Files          43       46       +3     
  Lines        4735     4244     -491     
==========================================
- Hits         4420     4066     -354     
+ Misses        192      178      -14     
+ Partials      123        0     -123     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shblue21 shblue21 changed the title Add Context.ValidateCtx feat(context): add ValidateCtx Oct 4, 2026
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.

1 participant