title: ASP.NET Core 6.0 Minimal API / Swagger tags
body: <p>Is there any way to change the tag for a given <code>http</code> method written with minimal api?</p>
  <pre class="lang-cs prettyprint-override"><code>builder.Services.AddEndpointsApiExplorer();
  builder.Services.AddSwaggerGen();
  
  ...
  
  app.MapGet(&quot;/todo&quot;, () =&gt; &quot;Hello world&quot;);
  </code></pre>
  <p>So that I can logically group methods in the documentation, similar to those that were when they were in the controllers.</p>
  <h3>Edited</h3>
  <p>I tried (hint from @Modar Na) <code>SwaggerOperation</code>, unfortunately it didn't help.</p>
  <pre class="lang-cs prettyprint-override"><code>app.MapGet(&quot;/todo&quot;, [SwaggerOperation(Tags = new[] { &quot;ToDo&quot; })]() =&gt; &quot;Hello world&quot;);
  app.MapPost(&quot;/todo&quot;, [SwaggerOperation(Tags = new[] { &quot;ToDo&quot; })]() =&gt; &quot;Hello world&quot;);
  
  app.MapGet(&quot;/projects&quot;, [SwaggerOperation(Tags = new[] { &quot;Projects&quot; })]() =&gt; &quot;Hello world&quot;);
  app.MapPost(&quot;/projects&quot;, [SwaggerOperation(Tags = new[] { &quot;Projects&quot; })]() =&gt; &quot;Hello world&quot;);
  </code></pre>
  <p><a href="https://i.stack.imgur.com/PAuzP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PAuzP.png" alt="enter image description here" /></a></p>
  <h2>Updated</h2>
  <p>As a workaround, I used the <code>TagActionsBy</code> method when configuring the swagger generator.</p>
  <pre class="lang-cs prettyprint-override"><code>builder.Services.AddSwaggerGen(c =&gt;
  {
      c.TagActionsBy(d =&gt;
      {
          return new List&lt;string&gt;() { d.ActionDescriptor.DisplayName! };
      });
  });
  </code></pre>
  <p>See my <a href="https://blog.burgyn.online/2021/10/13/asp-net-minimal-api-swagger-tags" rel="nofollow noreferrer">blog post</a>.</p>