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
Unfortunately, in the generic version, the property B becomes nullable although it is not so in the C# type definition. Here is a comparison of both schemas:
When this parameter is null, the call to InitializeNullableFlagsAndOriginalNullability ends with _emptyNullableFlags.
There is a big difference between both call stacks (non-generic vs generic) and the generic one leads to a call to GetCachedType which in turn passes null for the customAttributeProviders parameter.
I tried to debug it for hours (with a more complex type in the beginning) but I think more knowledge of the library internals is required to find the root cause. And I am not really sure if the bug is burried somewhere in this library or in NJsonSchema.
The text was updated successfully, but these errors were encountered:
I have the following setup to compare the schema of a non-generic type (
A
) to a generic version (A<B>
) :.csproj
:Program.cs
:Unfortunately, in the generic version, the property
B
becomesnullable
although it is not so in the C# type definition. Here is a comparison of both schemas:Output:
I think the reason is that there is no
customAttributeProviders
provided in the following call:Namotion.Reflection/src/Namotion.Reflection/Context/ContextualType.cs
Line 28 in a4bc634
When this parameter is
null
, the call toInitializeNullableFlagsAndOriginalNullability
ends with_emptyNullableFlags
.There is a big difference between both call stacks (non-generic vs generic) and the generic one leads to a call to
GetCachedType
which in turn passesnull
for thecustomAttributeProviders
parameter.I tried to debug it for hours (with a more complex type in the beginning) but I think more knowledge of the library internals is required to find the root cause. And I am not really sure if the bug is burried somewhere in this library or in
NJsonSchema
.The text was updated successfully, but these errors were encountered: