Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support json.RawMessage #350

Merged
merged 2 commits into from
Apr 2, 2024
Merged

feat: support json.RawMessage #350

merged 2 commits into from
Apr 2, 2024

Conversation

danielgtaylor
Copy link
Owner

This adds support for json.RawMessage which generates an empty schema (no validation). This means any input is valid and it's up to the handler code to determine if there are any errors.

Fixes #348.

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.28%. Comparing base (73362ec) to head (bb72a27).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #350      +/-   ##
==========================================
+ Coverage   95.25%   95.28%   +0.02%     
==========================================
  Files          19       19              
  Lines        2846     2840       -6     
==========================================
- Hits         2711     2706       -5     
+ Misses         98       97       -1     
  Partials       37       37              

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

@sven4all
Copy link

sven4all commented Apr 2, 2024

Looks good to me, this is the behaviour I would expect.

Is it an idea to add it to the documentation as well?

I am not sure where to include it but it could be here https://github.com/danielgtaylor/huma/blob/main/docs/docs/features/request-validation.md or here https://github.com/danielgtaylor/huma/blob/main/docs/docs/how-to/custom-validation.md.

@danielgtaylor danielgtaylor merged commit 85d94d8 into main Apr 2, 2024
5 checks passed
@danielgtaylor danielgtaylor deleted the json-raw-message branch April 2, 2024 16:05
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.

json.RawMessage support
2 participants