-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
docs: fix typos in docs, comments, and tests #596
Conversation
WalkthroughThe changes in this pull request include minor corrections to comments in various test files and documentation. Specifically, typos were fixed in comments and documentation across multiple files, enhancing clarity without altering any functionality. The documentation updates provide detailed explanations regarding the Service CLI, request inputs, request validation, schema customization, and OAuth 2.0 setup, ensuring users have accurate and comprehensive guidance. Changes
Possibly related PRs
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 (
|
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 (7)
docs/docs/features/schema-customization.md (3)
55-55
: Approved: Improved explanation ofhuma.Registry
The added explanation provides valuable context for the
huma.Registry
parameter. The link to the documentation is correct and helpful.Consider adding a brief explanation of what a
Registry
does in this context, e.g., "The Registry is responsible for generating and storing JSON Schemas for types in your API."
Line range hint
55-93
: Approved: Well-documentedOmittableNullable
struct and methodsThe addition of the
OmittableNullable
struct and its methods is well-documented and provides a clear example of custom schema implementation. The code is correct and the explanations are helpful.Consider adding a brief comment in the
Schema
method to explain why it's usingreflect.TypeOf(o.Value)
instead ofT
. This might help readers understand the relationship between the generic typeT
and the schema generation process.
Line range hint
95-124
: Approved: Clear example ofOmittableNullable
usageThe added example operation effectively demonstrates how to use the
OmittableNullable
struct in practice. It clearly shows how to handle different states of the field (omitted, null, or set to a value).Consider adding a brief note about how this approach compares to using a pointer to a string (
*string
). This could help readers understand when to useOmittableNullable
over simpler nullable types.humacli/humacli_test.go (1)
83-83
: Assertion added for the corrected field.The addition of
assert.False(t, options.ignore)
is consistent with the struct field name correction and ensures that theignore
field is being properly tested.Consider adding a brief comment explaining the purpose of this assertion, for example:
// Ensure the 'ignore' field is false by default assert.False(t, options.ignore)docs/docs/features/cli.md (1)
158-158
: Use fenced code block style for consistencyTo maintain consistency with the rest of the document and address the Markdownlint warning, consider changing the info block to use fenced code block style.
Here's the suggested change:
- You can also overwrite `cli.Root().Run` to completely customize how you run the server. Or just ditch the `cli` package altogether! +``` +You can also overwrite `cli.Root().Run` to completely customize how you run the server. Or just ditch the `cli` package altogether! +```🧰 Tools
🪛 Markdownlint
158-158: Expected: fenced; Actual: indented
Code block style(MD046, code-block-style)
docs/docs/features/request-inputs.md (2)
36-36
: Great clarification on query parameter handling!The added information about specifying query parameters multiple times and the explanation of the 'explode' tag significantly improves the documentation. The performance recommendation for using comma-separated lists is particularly valuable.
Consider adding a brief example of how to use the 'explode' tag in the struct definition for even more clarity. For instance:
type MyInput struct { Tags []string `query:"tags,explode"` }
Line range hint
101-140
: Great addition of Multipart Form Data section!The new section explaining support for multipart form data, including the example of how to use
RawBody
with themultipart.Form
type, is a valuable addition to the documentation. This covers an important use case for file uploads that was previously not documented.Consider adding a brief note or example on how to access the uploaded files from the
multipart.Form
. For instance:file, header, err := input.RawBody.File["fieldname"] if err != nil { // Handle error } // Use file and header as neededThis would provide a complete picture of how to handle file uploads using this method.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (10)
- adapters/humaflow/flow/flow_test.go (1 hunks)
- docs/docs/features/cli.md (1 hunks)
- docs/docs/features/request-inputs.md (1 hunks)
- docs/docs/features/request-validation.md (2 hunks)
- docs/docs/features/schema-customization.md (1 hunks)
- docs/docs/how-to/oauth2-jwt.md (1 hunks)
- humacli/humacli_test.go (1 hunks)
- openapi.go (1 hunks)
- schema.go (2 hunks)
- sse/sse_test.go (1 hunks)
✅ Files skipped from review due to trivial changes (5)
- adapters/humaflow/flow/flow_test.go
- docs/docs/features/request-validation.md
- openapi.go
- schema.go
- sse/sse_test.go
🧰 Additional context used
🪛 LanguageTool
docs/docs/features/cli.md
[style] ~155-~155: Using many exclamation marks might seem excessive (in this case: 9 exclamation marks for a text that’s 3958 characters long)
Context: ...available before running your command. !!! info "More Customization" You can ...(EN_EXCESSIVE_EXCLAMATION)
🪛 Markdownlint
docs/docs/features/cli.md
158-158: Expected: fenced; Actual: indented
Code block style(MD046, code-block-style)
🔇 Additional comments (10)
docs/docs/features/schema-customization.md (1)
Line range hint
1-134
: Overall: Excellent improvements to schema customization documentationThe changes in this file significantly enhance the clarity and completeness of the schema customization documentation. The added examples, particularly the
OmittableNullable
struct and its usage, provide valuable insights into advanced schema customization techniques. These improvements align well with the PR objective of fixing typos and enhancing documentation quality.Great work on improving this documentation! The changes will undoubtedly help users better understand and implement custom schemas in the Huma framework.
humacli/humacli_test.go (2)
76-83
: Overall assessment: Changes improve code quality and align with PR objectives.The corrections made in this file successfully address the typo issue, improving both the struct definition and the corresponding test assertion. These changes align well with the PR's objective of fixing typos in tests. The modifications enhance code readability and ensure proper testing of the
ignore
field.
76-76
: Typo correction approved.The change from
ingore
toignore
in theOptions
struct is correct and aligns with the PR objective of fixing typos. This improves code readability and maintains consistency with standard English spelling.To ensure all instances of this typo have been addressed, please run the following command:
docs/docs/features/cli.md (2)
154-157
: LGTM: Clear explanation of custom options usageThe explanation of how to access custom options in custom commands is clear and concise. The introduction of the
huma.WithOptions
utility function is well-documented and provides valuable information for users.🧰 Tools
🪛 LanguageTool
[style] ~155-~155: Using many exclamation marks might seem excessive (in this case: 9 exclamation marks for a text that’s 3958 characters long)
Context: ...available before running your command. !!! info "More Customization" You can ...(EN_EXCESSIVE_EXCLAMATION)
Line range hint
1-193
: LGTM: Well-structured and informative documentationThe documentation for the Service CLI is well-organized, clear, and informative. It provides comprehensive coverage of the feature's functionality and usage.
Note: The LanguageTool warning about excessive exclamation marks on line 155 is a false positive. The "!!!" is used for creating an info block in Markdown and is not actual exclamation marks in the text.
🧰 Tools
🪛 LanguageTool
[style] ~155-~155: Using many exclamation marks might seem excessive (in this case: 9 exclamation marks for a text that’s 3958 characters long)
Context: ...available before running your command. !!! info "More Customization" You can ...(EN_EXCESSIVE_EXCLAMATION)
🪛 Markdownlint
158-158: Expected: fenced; Actual: indented
Code block style(MD046, code-block-style)
docs/docs/features/request-inputs.md (3)
Line range hint
1-35
: Excellent improvements to the Parameters section!The addition of the table listing available tags with their descriptions and examples greatly enhances the clarity and usability of the documentation. The info box about the 'required' tag is a valuable addition, emphasizing important usage guidelines.
Line range hint
37-100
: Excellent addition of special types information!The new table listing special types supported for request bodies, along with their schemas and examples, is a valuable addition to the documentation. This information will be extremely helpful for developers working with various data types in their API requests.
Line range hint
1-140
: Overall excellent improvements to the documentation!The changes made to this file significantly enhance the quality and completeness of the documentation for request inputs. The additions and clarifications provide developers with a more comprehensive understanding of how to work with various input types, including parameters, request bodies, and multipart form data. These improvements will undoubtedly make it easier for developers to effectively use the API and implement various features.
Great job on these documentation updates!
docs/docs/how-to/oauth2-jwt.md (2)
113-113
: Improved clarity in API Gateway sectionThe modification enhances the readability of the sentence without altering its meaning. This change aligns well with the PR's objective of improving documentation clarity.
Line range hint
1-113
: Overall document reviewThe changes in this document are minimal and focused on improving clarity, which aligns well with the PR objectives of fixing typos and enhancing documentation. The overall structure and content of the document remain consistent with its original purpose of explaining OAuth2.0 authorization setup for APIs using Huma.
🧰 Tools
🪛 Markdownlint
110-110: 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! ❤️
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #596 +/- ##
=======================================
Coverage 92.80% 92.80%
=======================================
Files 22 22
Lines 3903 3903
=======================================
Hits 3622 3622
Misses 236 236
Partials 45 45 ☔ View full report in Codecov by Sentry. |
The PR corrects grammar mistakes in words.
Summary by CodeRabbit
Release Notes
Documentation Enhancements
Bug Fixes