Error generating typescript client System.Int64' cannot be converted to type 'System.Int32
See original GitHub issueEnvironment - ASP.NET Owin.
After upgrading NJsonSchema.CodeGeneration ^ NJsonSchema.CodeGeneration.TypeScript to 10.1.11 and NSwag.CodeGeneration.TypeScript 13.3.0 generator throws error. On any method (tried to mark all with [OpenApiIgnore], and find “bugged method” but without success)
NJsonSchema.CodeGeneration 10.1.5 and NSwag.CodeGeneration.TypeScript 13.2.3 version working fine.
Any clues how to fix it?
"Error while rendering Liquid template TypeScript/Class: System.ArgumentException: Object of type ‘System.Int64’ cannot be converted to type ‘System.Int32’.
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()
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
As I can see, it’s change in DotLiquid that introduced by
commit 7c168d18b4ec5665076e03cde8152ebceecb1985 Author: David Burg daviburg@microsoft.com Date: Tue Feb 25 13:14:34 2020 -0800
at Context.cs Contect class in function private object Resolve(string key, bool notifyNotFound = true)
Old code parses integers in such way:
new code parses integers and return long
after that it leads to exception in Strainer.Invoke due to dynamic “tab” filter invocation because it has signature {(, System.String Tab(DotLiquid.Context, System.String, Int32))}
The workaround is to downgrade DotLiquid to 2.0.314
Trying to make amends at https://github.com/dotliquid/dotliquid/pull/378