question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue
System.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

image

firstdata.gateway.json.txt

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
jeremyVignellescommented, Sep 7, 2020

@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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found