-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Describe the bug
Starting from version 6.7.2, MemberInfoExtensions.IsDictionaryValueNonNullable
contains a bug that throws an exception when the declaring type of a class property that is assignable to Dictionary{TKey,TValue}
has a number of generic type arguments that is not 2. This is easily possible when the declaring type extends Dictionary{TKey,TValue}
, e.g.
public class MyDictionary: Dictionary<string, string>
Instead of picking the generic type arguments of the declaring type, you need to look at the type arguments of the IDictionary
-interface of the declaring type.
Expected behavior
That no exception is thrown, just like in versions <= 6.7.1.
Actual behavior
An exception is thrown on initialization, causing Swagger to fail to load API definition.
Steps to reproduce
No response
Exception(s) (if any)
No response
Swashbuckle.AspNetCore version
6.7.2
.NET Version
8
Anything else?
No response