-
Notifications
You must be signed in to change notification settings - Fork 3
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
use parameter description if set #3
Conversation
WalkthroughThe changes involve updating the Changes
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
🧹 Nitpick comments (4)
src/openapi2excel/Builders/WorksheetPartsBuilders/Common/OpenApiSchemaDescriptor.cs (4)
34-34
: Introduce XML documentation for better clarityYou introduced a new optional parameter
string? description = null
. Consider adding XML documentation clarifying its purpose to help future maintainers and users of this method understand when and how to pass this parameter.
50-50
: Use a null-coalescing operator for concise expressionHere, you can use
schema.Description ?? description
to handle null or empty checks more succinctly. However, if empty strings carry a special meaning, your current logic is more explicit.
68-68
: Refactor repeated logic for maintainabilityThis line duplicates the logic used above. Consider encapsulating the repeated logic into a helper method to avoid code duplication and improve maintainability.
70-70
: Consistency check on return statementAlthough returning
cell.GetColumnNumber()
is consistent across both branches, it might be clearer to return outside the if-else block once, rather than separately in each branch, unless future expansions require each branch to do more distinct actions before returning.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/openapi2excel/Builders/WorksheetPartsBuilders/Common/OpenApiSchemaDescriptor.cs
(3 hunks)src/openapi2excel/Builders/WorksheetPartsBuilders/RequestParametersBuilder.cs
(1 hunks)
🔇 Additional comments (1)
src/openapi2excel/Builders/WorksheetPartsBuilders/RequestParametersBuilder.cs (1)
55-55
: Ensure robust handling of null or empty descriptions.
The addition of the parameter.Description
argument effectively meets the PR’s objective to include parameter descriptions in the generated output. However, consider adding or expanding unit tests to verify behavior when parameter.Description
is null or empty, ensuring that the schema descriptor logic gracefully accommodates various input states.
Thanks for your help and sorry for the delay |
You are welcome, thank you for openapi-2-excel
From: Paweł Szybiak ***@***.***>
Sent: mercoledì 15 gennaio 2025 12:15
To: pszybiak/openapi-2-excel ***@***.***>
Cc: Renzo Vannucci ***@***.***>; Author ***@***.***>
Subject: Re: [pszybiak/openapi-2-excel] use parameter description if set (PR #3)
Thanks for your help and sorry for the delay
—
Reply to this email directly, view it on GitHub<#3 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AW43A3O5VIZHPLES2DWF4732KY7LTAVCNFSM6AAAAABUNK3EKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJSGQYDMNRZGM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
this should add parameter description if openapimodel is something like this:
[..]
"/api/Integration/CreateProduct/{lineCode}": {
"post": {
"tags": [
"Integration"
],
"summary": "Create a new product in line\r\nNB: the barcode must be unique and not conflicting with line MH01",
"operationId": "Integration_CreateProduct",
"parameters": [
{
"name": "lineCode",
"in": "path",
"description": "line code",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateProductRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
}
}
[..]
Summary by CodeRabbit
New Features
Improvements