question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XML langword elements ignored when generating Swagger descriptions

See original GitHub issue

For this controller action:

[HttpPost]
[Route("{?index}"]
[SwaggerOperation("Action")]
/// <param name="index">The index of the record to store. <see langword="null"/> for the default record.</param>
public async Task<IHttpActionResult> ActionAsync(
    [FromUri, Range(0, int.MaxValue)] int? index = null,
    CancellationToken cancellationToken = default(CancellationToken))
{
    // ...
}

The Swagger description for the index parameter will be The index of the record to store. for the default record. instead of The index of the record to store. null for the default record..

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
RicoSutercommented, Nov 8, 2017

I think we should replace all <see ... /> tags with the “langword” attribute value… should be easy to implement.

0reactions
paulomorgadocommented, Nov 8, 2017

Try throwing a <see langword="null"/> in there. You’ll see that it will yield a space.

It would be nice if it yielded null.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XML comments are not shown in Swagger documentation ...
In my case, the XML comments were missing in Swagger because the API itself and the model classes are in different assemblies.
Read more >
Generating xml file for swagger is not working as it should
Generating xml file for swagger is not working as it should. What steps will reproduce the issue? Project properties -> Configurations (Debug or...
Read more >
Representing XML
OAS 3 This guide is for OpenAPI 3.0. Representing XML. In your API specification, you can describe data in both XML and JSON...
Read more >
Adding Swagger to ASP.NET Core Web API using XML ...
Here's the goal of this tutorial: to setup Swagger to use XML comments generated by ASP.NET, and to show a default Swagger UI...
Read more >
Using XML Comments As Web API Documentation With ...
This article demonstrage how to use C# XML Comments as a Web API documentation with Swagger.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found