Skip to content

feat: allow description line continuation - #2048

Merged
sdghchj merged 1 commit into
swaggo:masterfrom
berk-karaal:description-line-continuation
Jul 28, 2025
Merged

sdghchj merged 1 commit into
swaggo:masterfrom
berk-karaal:description-line-continuation

Conversation

@berk-karaal

Copy link
Copy Markdown
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
@berk-karaal
berk-karaal deleted the description-line-continuation branch July 28, 2025 04:37
pborgen pushed a commit to pborgen/swag that referenced this pull request Jan 8, 2026
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

⌂ 换网址