Closed jochenjonc closed 2 months ago
It seems that property1
below will be added to the API but property2
will not.
// Why does this get added to the API? It is private!
private string Property1 { get; }
// This does not get added to the API
private string Property2 { get; set; }
I believe this could be the same 'bug' that causes https://github.com/RicoSuter/NJsonSchema/issues/1661 and https://github.com/RicoSuter/NSwag/issues/4572
I clearly have no ability to add [JsonIgnore]
to the Exception property serializationWatsonBuckets
!!!
Tuple got fixed by https://github.com/RicoSuter/NJsonSchema/pull/1701
When trying to upgrade to NSwag 14 (on a dotnet 7 project) I noticed that the swagger.json and thus all code generated based on that specification includes internal and private properties on classes that are being used.
I have noticed that other people have reported similar things but as a solution added [JsonIgnore] to these properties. See #4681 and some comments on #4524.
But for some types that isn't a solution, for instance for a Tuple that is part of dotnet.
NSwag 13 generated the following for a Tuple:
NSwag 14 includes 2 private properties:
Is there any idea on how to fix this? What has changed between NSwag 13 and 14 that changes this behavior? If someone can point me in some direction I could have a look myself.