这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ross96D
Copy link
Contributor

@ross96D ross96D commented May 11, 2024

fix #433

@codecov
Copy link

codecov bot commented May 11, 2024

Codecov Report

Attention: Patch coverage is 96.34703% with 8 lines in your changes missing coverage. Please review.

Project coverage is 92.60%. Comparing base (e089398) to head (c2e4242).
Report is 314 commits behind head on main.

Files with missing lines Patch % Lines
huma.go 96.34% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #438      +/-   ##
==========================================
- Coverage   92.76%   92.60%   -0.16%     
==========================================
  Files          21       21              
  Lines        3567     3599      +32     
==========================================
+ Hits         3309     3333      +24     
- Misses        220      226       +6     
- Partials       38       40       +2     

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

@danielgtaylor
Copy link
Owner

@ross96D thanks for the PR. I was looking into this one last night and wanted to give a brief update. I think you correctly identified a problem with custom param validation. I'm not sure a second method to convert from []byte is the best approach, so I'm thinking about what would be best for this feature. I thought about a custom Validate method but it wouldn't be used for body validation as that happens before the inputs are parsed into the struct values. 🤔 ... We could just return a value via some method so it can be used for validation. I'll try to propose something for this soon.

@victoraugustolls
Copy link
Contributor

victoraugustolls commented May 15, 2024

Could we add docs for this?

@danielgtaylor
Copy link
Owner

I think this should now be handled in a fast way without additional memory allocations by https://github.com/danielgtaylor/huma/releases/tag/v2.29.0 param enhancements like the ParamWrapper interface to return the reflect.Value to set. Please let me know if that doesn't resolve things!

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.

Allow custom query param types.

3 participants