Error while rendering Liquid template CSharp/Class: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OverflowException: Value was either too large or too small for an Int32.
See original GitHub issueSystem.InvalidOperationException: Error while rendering Liquid template CSharp/Class:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OverflowException: Value was either too large or too small for an Int32.
Runtime: NetCore22
at System.Decimal.ToInt32(Decimal d)
at System.Decimal.System.IConvertible.ToInt32(IFormatProvider provider)
at NJsonSchema.CodeGeneration.CSharp.CSharpValueGenerator.GetNumericValue(JsonObjectType type, Object value, String format)
at NJsonSchema.CodeGeneration.CSharp.Models.PropertyModel.get_RangeMaximumValue()
--- End of inner exception stack trace ---
at DotLiquid.Context.HandleError(Exception ex)
at DotLiquid.Block.RenderAll(List`1 list, Context context, TextWriter result)
at DotLiquid.Document.Render(Context context, TextWriter result)
at DotLiquid.Template.RenderInternal(TextWriter result, RenderParameters parameters)
at DotLiquid.Template.Render(TextWriter writer, RenderParameters parameters)
at DotLiquid.Template.Render(RenderParameters parameters)
at NJsonSchema.CodeGeneration.DefaultTemplateFactory.LiquidTemplate.Render() ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OverflowException: Value was either too large or too small for an Int32.
at System.Decimal.ToInt32(Decimal d)
at System.Decimal.System.IConvertible.ToInt32(IFormatProvider provider)
at NJsonSchema.CodeGeneration.CSharp.CSharpValueGenerator.GetNumericValue(JsonObjectType type, Object value, String format)
at NJsonSchema.CodeGeneration.CSharp.Models.PropertyModel.get_RangeMaximumValue()
--- End of inner exception stack trace ---
at DotLiquid.Context.HandleError(Exception ex)
at DotLiquid.Block.RenderAll(List`1 list, Context context, TextWriter result)
at DotLiquid.Document.Render(Context context, TextWriter result)
at DotLiquid.Template.RenderInternal(TextWriter result, RenderParameters parameters)
at DotLiquid.Template.Render(TextWriter writer, RenderParameters parameters)
at DotLiquid.Template.Render(RenderParameters parameters)
at NJsonSchema.CodeGeneration.DefaultTemplateFactory.LiquidTemplate.Render()
--- End of inner exception stack trace ---
at NJsonSchema.CodeGeneration.DefaultTemplateFactory.LiquidTemplate.Render()
at NJsonSchema.CodeGeneration.CSharp.CSharpGenerator.GenerateClass(JsonSchema schema, String typeName)
at NJsonSchema.CodeGeneration.GeneratorBase.GenerateTypes()
at NJsonSchema.CodeGeneration.CSharp.CSharpGenerator.GenerateTypes()
at NSwag.CodeGeneration.ClientGeneratorBase`3.GenerateFile(ClientGeneratorOutputType outputType) in C:\projects\nswag\src\NSwag.CodeGeneration\ClientGeneratorBase.cs:line 75
at NSwag.Commands.CodeGeneration.SwaggerToCSharpClientCommand.<RunAsync>b__83_0() in C:\projects\nswag\src\NSwag.Commands\Commands\CodeGeneration\OpenApiToCSharpClientCommand.cs:line 242
at NSwag.Commands.CodeGeneration.SwaggerToCSharpClientCommand.RunAsync() in C:\projects\nswag\src\NSwag.Commands\Commands\CodeGeneration\OpenApiToCSharpClientCommand.cs:line 228
at NSwag.Commands.CodeGeneration.SwaggerToCSharpClientCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\CodeGeneration\OpenApiToCSharpClientCommand.cs:line 217
at NSwag.Commands.NSwagDocument.ExecuteAsync() in C:\projects\nswag\src\NSwag.Commands\NSwagDocument.cs:line 85
at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 85
at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 32
at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input)
at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input)
at NConsole.CommandLineProcessor.Process(String[] args, Object input)
at NSwag.Commands.NSwagCommandProcessor.Process(String[] args) in C:\projects\nswag\src\NSwag.Commands\NSwagCommandProcessor.cs:line 56
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error while rendering Liquid template CSharp/Class: ...
TargetInvocationException : Exception has been thrown by the target of an ... System.OverflowException: Value was either too large or too small for an...
Read more >'Exception has been thrown by the target of an invocation. ...
ExternalException: A generic error occurred in GDI+. System.Reflection.TargetInvocationException HResult=0x80131604 Message=Exception has ...
Read more >System.Reflection.TargetInvocationException when ...
I'm trying to run a excel macro from my C# code, but I'm getting the following error when trying to execute the code....
Read more >sitemap-questions-240.xml
... -a-bug-issue-tracking-system-which-integrates-with-mercurial 2017-06-16 ... ://stackoverflow.com/questions/3192232/getwindowrect-too-small-on-windows-7 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
“Bug” in https://github.com/RicoSuter/NJsonSchema/blob/958afa39a8386a6f02bf6604aca742e4d18acb61/src/NJsonSchema.CodeGeneration.CSharp/CSharpValueGenerator.cs#L93
@drmcclelland : Replying to a closed issue is not the proper way on GitHub to get help. Please open a new issue and provide a minimal project to reproduce the issue, like this one, which you can fork 😃