Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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