-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Update request-resolvers.md #619
Conversation
Typo fix in code snippet.
WalkthroughThe documentation for request resolvers in Go has been updated to enhance clarity regarding custom validation and transformations for request inputs. Key changes include a refined example of the Changes
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #619 +/- ##
=======================================
Coverage 92.88% 92.88%
=======================================
Files 22 22
Lines 4834 4834
=======================================
Hits 4490 4490
Misses 299 299
Partials 45 45 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
docs/docs/features/request-resolvers.md (2)
50-50
: Approve the addition of theLocation
field with a minor formatting suggestion.The addition of the
Location
field in thehuma.ErrorDetail
struct is a good improvement. It enhances the error information by specifying where the error occurred, which aligns well with the documentation's emphasis on providing exhaustive and informative errors.Consider replacing the hard tab with spaces to maintain consistent formatting throughout the document:
- Location: prefix.With("foo"), + Location: prefix.With("foo"),🧰 Tools
🪛 Markdownlint
50-50: Column: 1
Hard tabs(MD010, no-hard-tabs)
Expanded Section on Custom HTTP Status Codes is Missing
- The documentation does not include the expanded section on custom HTTP status codes for resolvers.
🔗 Analysis chain
Line range hint
1-114
: Verify implementation of described changes and offer assistance.The AI summary indicates several improvements to the documentation, including:
- Refined example of the
Resolve
method with improved error handling- Guidance against saving context objects
- Expanded section on custom HTTP status codes for resolvers
- New example for checking interface implementation
While the change we can see directly improves the error handling example, it would be beneficial to verify that all the other described improvements have been implemented correctly throughout the document.
To assist in verifying these changes, you can run the following script:
If any of these changes are not fully implemented or if you need assistance in further improving the documentation, please let me know, and I'd be happy to help.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of described changes in the documentation. # Test 1: Check for improved error handling example echo "Checking for improved error handling example:" rg -A 5 "func \(m \*MyInput\) Resolve\(ctx huma\.Context" docs/docs/features/request-resolvers.md # Test 2: Check for guidance against saving context objects echo "Checking for guidance against saving context objects:" rg "do not save the context object" docs/docs/features/request-resolvers.md # Test 3: Check for expanded section on custom HTTP status codes echo "Checking for expanded section on custom HTTP status codes:" rg -A 5 "huma\.StatusError interface" docs/docs/features/request-resolvers.md # Test 4: Check for new example of interface implementation check echo "Checking for new example of interface implementation check:" rg -A 3 "var _ huma\.Resolver = \(\*MyInput\)\(nil\)" docs/docs/features/request-resolvers.mdLength of output: 1870
🧰 Tools
🪛 Markdownlint
48-48: Column: 1
Hard tabs(MD010, no-hard-tabs)
49-49: Column: 1
Hard tabs(MD010, no-hard-tabs)
50-50: Column: 1
Hard tabs(MD010, no-hard-tabs)
51-51: Column: 1
Hard tabs(MD010, no-hard-tabs)
52-52: Column: 1
Hard tabs(MD010, no-hard-tabs)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- docs/docs/features/request-resolvers.md (1 hunks)
🧰 Additional context used
🪛 Markdownlint
docs/docs/features/request-resolvers.md
50-50: Column: 1
Hard tabs(MD010, no-hard-tabs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
Typo fix in code snippet.
Summary by CodeRabbit
Resolve
method, focusing on error handling and theLocation
field.