Skip to content

fix(group): ensure "Group" satisfies the configProvider interface#976

Merged
wolveix merged 3 commits intodanielgtaylor:mainfrom
leonklingele:fix/group-config-provider
Feb 19, 2026
Merged

fix(group): ensure "Group" satisfies the configProvider interface#976
wolveix merged 3 commits intodanielgtaylor:mainfrom
leonklingele:fix/group-config-provider

Conversation

@leonklingele
Copy link
Contributor

Before this change, using Huma's route group feature would not propagate Huma's config to the group router and cause all routes attached to a group to use a default Huma config.

Before this change, using Huma's route group feature would not propagate Huma's
config to the group router and cause all routes attached to a group to use a
default Huma config.
Copilot AI review requested due to automatic review settings February 19, 2026 07:14
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (58edcf2) to head (f658a43).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #976   +/-   ##
=======================================
  Coverage   93.11%   93.12%           
=======================================
  Files          23       23           
  Lines        4766     4768    +2     
=======================================
+ Hits         4438     4440    +2     
  Misses        269      269           
  Partials       59       59           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a bug where route groups were not propagating Huma's configuration, causing all routes attached to a group to use default config values instead of the API's configured values.

Changes:

  • Added Config() method to Group type to implement the configProvider interface
  • Added compile-time interface assertions to ensure Group, api, and mapRegistry properly implement their respective interfaces
  • Added test case to verify config propagation works correctly for grouped routes

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
group.go Implemented Config() method for Group type and added interface assertions
api.go Added compile-time interface assertions for api type
registry.go Added compile-time interface assertions for mapRegistry type
huma_test.go Added test to verify config propagation through groups

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wolveix
Copy link
Collaborator

wolveix commented Feb 19, 2026

Great catch! The tests should include group in their name, since currently they look the same as the normal tests.

I like the interface implementation requirement, though there should be a comment with them so they're clear to everyone :)

@leonklingele leonklingele force-pushed the fix/group-config-provider branch from 8f8aae2 to f658a43 Compare February 19, 2026 12:09
@leonklingele
Copy link
Contributor Author

Updated, ptal :)

@wolveix wolveix merged commit 6d0295c into danielgtaylor:main Feb 19, 2026
4 checks passed
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.

3 participants