Open M0destru opened 7 months ago
Same error for me on a model having a protected JsonSerilaizerOptions _options;
.
Is this being worked on? Is there any workaround for it? Why does it consider protected members in the reflection process?
My temporary solution is to set
openApiconfig.SchemaSettings.ExcludedTypeNames = [typeof(JsonSerializerOptions).FullName];
After upgrading to NET8 and NSwag version >=14 documentation cannot be generated for controller method that returns such a model:
The problem arises with the line that represents JSON serialization settings for the class.
Exception:
In version 13.20.0 it works correctly. I am attaching a fully working example. NSwagExample.zip There is a .csproj to run the version on NSwag 13.20.0 (.NET6) and also 14.0.2 (.NET8), when throws exception