Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Comments Format Poorly in Swagger UI

I am using Swashbuckle to setup Swagger UI and have it display my XML Comments on my operations.

When I do this, they end up looking very squished. Here is an example of what it looks like without comments:

Looks Good But No Comments

Here is what it looks like with comments:

Has Comments But Method Name is Squished

Is there someway to get Swagger UI to allocate more space for the Operation Name?

like image 556
Vaccano Avatar asked Jun 04 '26 08:06

Vaccano


1 Answers

<summary> is supposed to be a short summary, like "Create a foo" or "Return a foo by ID". Long descriptions containing usage details should go to <remarks>. <remarks> corresponds to OpenAPI description field; Swagger UI displays these descriptions in expanded operations. These descriptions can be formatted using Markdown for rich text representation.

/// <summary>
/// Create a foo
/// </summary>
/// <remarks>
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit,
/// sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
/// Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
/// nisi ut aliquip ex ea commodo consequat.
/// </remarks>
like image 167
Helen Avatar answered Jun 06 '26 07:06

Helen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!