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
I've a problem with my openapi.json file openapi.zip for a MicroStrategy REST API. During Code generation an error occurs.
System.InvalidOperationException: Error while rendering Liquid template CSharp/Client.Class:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.NullReferenceException: Object reference not set to an instance of an object.
Runtime: Net50
at NSwag.CodeGeneration.Models.OperationModelBase`2.get_UnwrappedResultType() in C:\projects\nswag\src\NSwag.CodeGeneration\Models\OperationModelBase.cs:line 120
at NSwag.CodeGeneration.CSharp.Models.CSharpOperationModel.get_SyncResultType() in C:\projects\nswag\src\NSwag.CodeGeneration.CSharp\Models\CSharpOperationModel.cs:line 127
Do you have any hint why this happens? Perhaps the file is invalid? Does NSwag have any verbose log oportunities for analyzing this problem? Thx a lot.
Regards
Thomas
The text was updated successfully, but these errors were encountered:
thomasjoscht
changed the title
Error during code generation - InvalidOperationException ()
Error during code generation - NullReferenceException
Dec 15, 2020
The build action of file Client.Class.Annotations in NSwag.CodeGeneration.CSharp/Templates is wrong. It is set to nothing instead of "embedded". This must be fixed.
Missing schema handling
In class OperationModelBase.UnwrappedResultType no check for missing schema exists. In my case the openapi.json is a little bit invalid because of sometimes missing schema definitions. Perhaps this should be fixed for a default to string or void.
Hey,
I've a problem with my openapi.json file openapi.zip for a MicroStrategy REST API. During Code generation an error occurs.
System.InvalidOperationException: Error while rendering Liquid template CSharp/Client.Class:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.NullReferenceException: Object reference not set to an instance of an object.
Runtime: Net50
at NSwag.CodeGeneration.Models.OperationModelBase`2.get_UnwrappedResultType() in C:\projects\nswag\src\NSwag.CodeGeneration\Models\OperationModelBase.cs:line 120
at NSwag.CodeGeneration.CSharp.Models.CSharpOperationModel.get_SyncResultType() in C:\projects\nswag\src\NSwag.CodeGeneration.CSharp\Models\CSharpOperationModel.cs:line 127
Do you have any hint why this happens? Perhaps the file is invalid? Does NSwag have any verbose log oportunities for analyzing this problem? Thx a lot.
Regards
Thomas
The text was updated successfully, but these errors were encountered: