-
Notifications
You must be signed in to change notification settings - Fork 230
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
Summary/Description Generation Issue with Multiline First Sentences. #942
Comments
Thanks for noticing, it seems that long paragraphs are not taken in account when separating the description and summary in that specific commit. I'll add it to the todo list and fix this as one of the next things. |
Priot to this PR the summary and description was blindly split by the first line of the doc comment of path operaiton. This caused long multi line summaries to be split from illogically bleeding part of the summary to the description. More context can be found from issue #942. This commit fixes this as from now one comments as follows will be correctly split by paragraph. Where first paragraph will resolve to summary and rest will become the description. ```rust /// This is test operation long multiline /// summary. That need to be correctly split. /// /// Additional info in long description /// /// With more info on separate lines /// containing text. /// /// Yeah ``` Follow up for #881 and #439 Fixes #942
Priot to this PR the summary and description was blindly split by the first line of the doc comment of path operaiton. This caused long multi line summaries to be split from illogically bleeding part of the summary to the description. More context can be found from issue #942. This commit fixes this as from now one comments as follows will be correctly split by paragraph. Where first paragraph will resolve to summary and rest will become the description. ```rust /// This is test operation long multiline /// summary. That need to be correctly split. /// /// Additional info in long description /// /// With more info on separate lines /// containing text. /// /// Yeah ``` Follow up for #881 and #439 Fixes #942
Thanks for the quick fix @juhaku |
The problem seems to be back/not fixed. Using Utoipa v4.2.3, utoipa-gen v4.3.0. The following Rust: /// Reset ping counts for all reviewers. It will recalculate the ping counts for
/// all reviewers, not considering spent pings.
#[utoipa::path(
// ...
)]
#[post("/api/v0/repositories/{repo_id}/reset-pings")]
pub async fn reset_pings() Creates: /api/v0/repositories/{repo_id}/reset-pings:
post:
tags:
- repositories
summary: Reset ping counts for all reviewers. It will recalculate the ping counts for
description: |-
all reviewers, not considering spent pings. The summary is cut off at the line end, but the sentence continues on the next line. |
In 5aa9749 a change was introduced to skip the first line in the description.
The only downside to this is that, when the first line spans more than one line, the generated openapi is made meaningless because the first line is removed.
For example given:
The generated spec will be
Making both the summary and description meaningless.
The text was updated successfully, but these errors were encountered: