Skip to content

fix: honor group validation settings at runtime - #1121

Open
Arvin-Lee wants to merge 1 commit into
danielgtaylor:mainfrom
Arvin-Lee:bugfix/1010-group-validation-flags
Open

Arvin-Lee wants to merge 1 commit into
danielgtaylor:mainfrom
Arvin-Lee:bugfix/1010-group-validation-flags

Conversation

@Arvin-Lee

Copy link
Copy Markdown
Contributor

Fixes #1010.

SkipValidateBody and SkipValidateParams set through group modifiers or OnAddOperation hooks were ignored for prefixed groups because the request handler read the original operation instead of the modified route-specific copy.

This change preserves hook-configured validation flags during route registration and uses each route’s flags at request time. Sibling routes retain independent validation settings.

Regression tests cover:

  • Both flags independently and together.
  • Group modifiers and OnAddOperation hooks.
  • Nested groups and multiple prefixes.
  • Hidden routes.

Validation on Go 1.27.1:

  • Regression tests fail before the fix and pass afterward.
  • GOEXPERIMENT=nojsonv2 go test -race ./... passes.
  • With the default Go 1.27 configuration, all packages pass except for four previously observed YAML tests.
  • git diff --check passes.

@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.20%. Comparing base (5d2b1be) to head (a471ae6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1121      +/-   ##
==========================================
+ Coverage   93.19%   93.20%   +0.01%     
==========================================
  Files          24       24              
  Lines        5008     5019      +11     
==========================================
+ Hits         4667     4678      +11     
  Misses        273      273              
  Partials       68       68              

☔ 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.

This branch has not been deployed

No deployments
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.

SkipValidateBody/SkipValidateParams not being propagated through UseModifier and OnAddOperation

1 participant