Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;

namespace Swashbuckle.AspNetCore.Annotations
{
Expand All @@ -27,8 +27,8 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context)
}
#endif

// NOTE: When controller and action attributes are applicable, action attributes should take precendence.
// Hence why they're at the end of the list (i.e. last one wins).
// NOTE: When controller and action attributes are applicable, action attributes should take priority.
// Hence, why they're at the end of the list (i.e. last one wins).
// Distinct() is applied due to an ASP.NET Core issue: https://github.com/dotnet/aspnetcore/issues/34199.
var allAttributes = controllerAttributes
.Union(actionAttributes)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;

namespace Swashbuckle.AspNetCore.Annotations
{
Expand All @@ -22,7 +22,7 @@ public void Apply(OpenApiSchema schema, SchemaFilterContext context)
ApplyTypeAnnotations(schema, context);

// NOTE: It's possible for both MemberInfo and ParameterInfo to have non-null values - i.e. when the schema is for a property
// within a class that is bound to a parameter. In this case, the MemberInfo should take precendence.
// within a class that is bound to a parameter. In this case, the MemberInfo should take precedence.

if (context.MemberInfo != null)
{
Expand Down