You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that herited action method does not show the lock icon with SecurityRequirementsOperationFilter.
For the moment, I have bypassed this issue by cloning your SecurityRequirementsOperationFilter (generic and non generic) classes and replaced extension method GetControllerAndActionAttributes by this one :
public static IEnumerable<T> GetControllerAndActionAttributes<T>(this OperationFilterContext context) where T : Attribute
{
var controllerAttributes = context.GetControllerTypeInfos().GetTypeInfo().GetCustomAttributes<T>();
var actionAttributes = context.MethodInfo.GetCustomAttributes<T>();
var result = new List<T>(controllerAttributes);
result.AddRange(actionAttributes);
return result;
}
public static TypeInfo GetControllerTypeInfos(this OperationFilterContext context)
{
ControllerActionDescriptor controllerActionDescriptor = context.ApiDescription.ActionDescriptor as ControllerActionDescriptor;
TypeInfo controllerType = controllerActionDescriptor?.ControllerTypeInfo;
controllerType ??= context.MethodInfo.DeclaringType?.GetTypeInfo();
return controllerType;
}
maybe quick & dirty, but it works ;)
The text was updated successfully, but these errors were encountered:
Hi there
I've noticed that herited action method does not show the lock icon with SecurityRequirementsOperationFilter.
For the moment, I have bypassed this issue by cloning your SecurityRequirementsOperationFilter (generic and non generic) classes and replaced extension method GetControllerAndActionAttributes by this one :
maybe quick & dirty, but it works ;)
The text was updated successfully, but these errors were encountered: