Forum

PureSourceCode.com Forum
Share:
Notifications
Clear all

Add Swagger description to minimal .NET6 APIs

0 Posts
1 Users
0 Likes
949 Views
(@enrico)
Member Admin
Joined: 4 years ago
Posts: 151
Topic starter  

I have a small project in .NET6 that contains minimal APIs like that one

app.MapGet("/clients",
  async (IClientRepository repo) =>
  {
      var results = await repo.GetClientsAsync();
      return mapper.Map<
        IEnumerable<ClientModel>
      >(results);
  });

In the SwaggerUI I can use this API but I can't find a way to add description to it (although in the project settings I check for creating an API XML documentation).

How can I add the XML comment?


   
Quote
Share: