Skip to content

feat: allow description line continuation #2048

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

Merged
merged 1 commit into from
Jul 28, 2025

Conversation

berk-karaal
Copy link
Contributor

Describe the PR
This PR adds support for escaping newlines in @description annotations. This allows for long descriptions to be split across multiple lines in the source code for better readability, without introducing unwanted newlines in the generated Swagger UI.

Relation issue
fixes #2047

Additional context
This feature is implemented by introducing a new AppendDescription utility function that handles the concatenation of description lines based on the presence of a trailing backslash.

Unit tests for the AppendDescription function and an end-to-end test for the line continuation have been added to ensure the correct behavior.

@sdghchj sdghchj merged commit f676981 into swaggo:master Jul 28, 2025
10 checks passed
@berk-karaal berk-karaal deleted the description-line-continuation branch July 28, 2025 04:37
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.

Feature: Allow newline escaping in @description
2 participants