Using the below code, it's telling me that declaringType
isn't checked for null on the last line show. The previous line though is going to guarantee that declaringType
isn't null, to the best of my understanding.
C#public sealed class SwaggerAuthenticationRequirementsOperationFilter : IOperationFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context) {
if (context.MethodInfo.DeclaringType is { } declaringType) {
var declaringTypeAttributes = declaringType.GetCustomAttributes(inherit: true);
Scott,
I reproduced this issue. We will fix it.