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
When a schema (object) only inherits properties from a base object and does not have own properties then the corresponding C# class is not generated and on the Base object no JsonInheritanceAttribute is generated.
I tried to circumvent this by setting an additional Attribute on BaseObject with the objectType: ObjectA, however, it turns out that a stackoverflow occurs when trying to write a BaseObject.
Eventhough ObjectA in general equals the BaseObject, it might still be necessary for the API to know wheter it receives ObjectA or only a BaseObject.
Version used
14.2.0
To Reproduce
generate C# Client in Nswag Studio with the default settings and the following specification:
Describe the bug
When a schema (object) only inherits properties from a base object and does not have own properties then the corresponding C# class is not generated and on the Base object no JsonInheritanceAttribute is generated.
I tried to circumvent this by setting an additional Attribute on BaseObject with the objectType: ObjectA, however, it turns out that a stackoverflow occurs when trying to write a BaseObject.
Eventhough ObjectA in general equals the BaseObject, it might still be necessary for the API to know wheter it receives ObjectA or only a BaseObject.
Version used
14.2.0
To Reproduce
generate C# Client in Nswag Studio with the default settings and the following specification:
Expected behavior
A C# Class for Object A should be generated like:
A JsonInheritanceAttribute should be generated on the Base Object:
The text was updated successfully, but these errors were encountered: