Skip to content

Commit

Permalink
Update AspNetCoreOpenApiDocumentGenerator.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
MattParkerDev committed Jun 20, 2024
1 parent 8af0c71 commit ff50426
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
Expand Down Expand Up @@ -532,6 +533,12 @@ private string GetOperationId(OpenApiDocument document, ApiDescription apiDescri
.FirstOrDefault()?
.RouteName;

var prefix = apiDescription.ActionDescriptor.EndpointMetadata.OfType<TagsAttribute>().FirstOrDefault()?.Tags.FirstOrDefault();
if (!string.IsNullOrWhiteSpace(prefix))
{
routeName = prefix + "_" + routeName;
}

if (routeName != null)
{
return routeName;
Expand Down

0 comments on commit ff50426

Please sign in to comment.