Skip to content

Add encoding.TextUnmarshaler support for slice query parameters#1021

Merged
wolveix merged 3 commits into
danielgtaylor:mainfrom
B94715:main
May 28, 2026
Merged

Add encoding.TextUnmarshaler support for slice query parameters#1021
wolveix merged 3 commits into
danielgtaylor:mainfrom
B94715:main

Conversation

@B94715

@B94715 B94715 commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

I must apologise, I accidentally pushed a PR (#1020) mistakenly commenting out tests that I did not own and didn't catch this until it was too late. I closed the PR immediately to rectify the issue but wasn't aware that GitHub automatically locks closed PRs when --force-with-lease is applied to a git push. The original PR was thus

--

This directly addresses #488 and is an alternative to #998.

parseSliceInto() was missing the encoding.TextUnmarshaler fallback that parseInto() already has. This aims to address that.

@wolveix wolveix added the enhancement New feature or request label Apr 29, 2026
@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.05%. Comparing base (0dc6f40) to head (b121ed1).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
huma.go 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1021      +/-   ##
==========================================
- Coverage   93.07%   93.05%   -0.03%     
==========================================
  Files          23       23              
  Lines        4781     4868      +87     
==========================================
+ Hits         4450     4530      +80     
- Misses        271      274       +3     
- Partials       60       64       +4     

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

B94715 and others added 2 commits April 30, 2026 09:52
- Added test case to simulate an UnmarshalError in `parseSliceInto()`
- Added test case to simulate returning ErrUnparsable from `parseSliceInto()`
@wolveix

wolveix commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Awesome work, thanks @B94715!

@wolveix wolveix closed this May 28, 2026
@wolveix wolveix reopened this May 28, 2026
@wolveix
wolveix merged commit c5724f1 into danielgtaylor:main May 28, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants