Skip to content

Commit 073c268

Browse files
Resolve TODO
Resolve one TODO, but swap for another.
1 parent 7579d34 commit 073c268

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/Swashbuckle.AspNetCore.Annotations/AnnotationsOperationFilter.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
using Microsoft.OpenApi.Models;
55
using Swashbuckle.AspNetCore.SwaggerGen;
66

7+
#if NET10_0
8+
using OpenApiTag = Microsoft.OpenApi.Models.References.OpenApiTagReference;
9+
#else
10+
using OpenApiTag = Microsoft.OpenApi.Models.OpenApiTag;
11+
#endif
12+
713
namespace Swashbuckle.AspNetCore.Annotations
814
{
915
public class AnnotationsOperationFilter : IOperationFilter
@@ -63,13 +69,15 @@ private static void ApplySwaggerOperationAttribute(
6369
if (swaggerOperationAttribute.OperationId != null)
6470
operation.OperationId = swaggerOperationAttribute.OperationId;
6571

66-
// TODO Fix this
67-
#if !NET10_0_OR_GREATER
6872
if (swaggerOperationAttribute.Tags != null)
6973
{
74+
#if NET10_0_OR_GREATER
75+
// TODO Get the document?
76+
operation.Tags = [.. swaggerOperationAttribute.Tags.Select(tagName => new OpenApiTag(tagName, null))];
77+
#else
7078
operation.Tags = [.. swaggerOperationAttribute.Tags.Select(tagName => new OpenApiTag { Name = tagName })];
71-
}
7279
#endif
80+
}
7381
}
7482

7583
public static void ApplySwaggerOperationFilterAttributes(

0 commit comments

Comments
 (0)