NSwag Build 958

Created on 25 Jan 2018  Â·  8Comments  Â·  Source: RicoSuter/NSwag

My schema is working with v11.12.16.0

I updated NSwagStudio and tried to Generate a c# client
But get an exception when i click GenerateOutput

Encoding problems in the new version?

Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: x. Path 'swaggerGenerator.fromSwagger.json', line 5, position 26.
vid Newtonsoft.Json.JsonTextReader.ParsePostValue()
vid Newtonsoft.Json.JsonTextReader.Read()
vid Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
vid Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
vid Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
vid Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
vid NSwag.Commands.NSwagDocumentBase.<>c__DisplayClass35_0`1.<b__0>d.MoveNext()
--- Slut p† stacksp†rningen fr†n f”reg†ende plats d„r ett undantag utl”stes ---
vid System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid NSwag.Commands.NSwagDocument.d__7.MoveNext()
--- Slut p† stacksp†rningen fr†n f”reg†ende plats d„r ett undantag utl”stes ---
vid System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

bug

Most helpful comment

Oh shit, sorry... will fix this asap

All 8 comments

We're getting the same thing with our JSON as well as the default petstore JSON, but only if we first click Create local Copy. If you just click Generate Outputs, it works for us.

Oh shit, sorry... will fix this asap

Similar issues with NSwag Studio, works fine on v.11.12.60 for both C# and specification generation. I'm just click Generate Outputs not Create local Copy but on 11.13.0 I get:

System.MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute..ctor(Int32)'.

Runtime: NetCore20
at System.ModuleHandle.ResolveMethod(RuntimeModule module, Int32 methodToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount)
at System.ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, Int32 methodToken, IntPtr[] typeInstantiationContext, Int32 typeInstCount, IntPtr[] methodInstantiationContext, Int32 methodInstCount)
at System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit)
at NSwag.SwaggerGeneration.WebApi.WebApiToSwaggerGenerator.<>c.b__14_1(MethodInfo m) in C:\projects\nswag\src\NSwag.SwaggerGeneration.WebApi\WebApiToSwaggerGenerator.cs:line 231
at System.Linq.Utilities.<>c__DisplayClass1_01.<CombinePredicates>b__0(TSource x) at System.Linq.Utilities.<>c__DisplayClass1_01.b__0(TSource x)
at System.Linq.Enumerable.WhereArrayIterator1.MoveNext() at NSwag.SwaggerGeneration.WebApi.WebApiToSwaggerGenerator.<GenerateForControllerAsync>d__11.MoveNext() in C:\projects\nswag\src\NSwag.SwaggerGeneration.WebApi\WebApiToSwaggerGenerator.cs:line 139 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.SwaggerGeneration.WebApi.WebApiToSwaggerGenerator.<GenerateForControllersAsync>d__9.MoveNext() in C:\projects\nswag\src\NSwag.SwaggerGeneration.WebApi\WebApiToSwaggerGenerator.cs:line 95 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.SwaggerGeneration.WebApiToSwaggerCommand.<RunIsolatedAsync>d__88.MoveNext() in C:\projects\nswag\src\NSwag.Commands\Commands\SwaggerGeneration\WebApiToSwaggerCommand.cs:line 191 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.IsolatedCommandBase1.IsolatedCommandAssemblyLoader1.Run(String commandType, String commandData, String[] assemblyPaths, String[] referencePaths) in C:\projects\nswag\src\NSwag.Commands\Commands\IsolatedCommandBase.cs:line 59 at NSwag.Commands.IsolatedCommandBase1.<>c__DisplayClass13_0.b__0() in C:\projects\nswag\src\NSwag.Commands\Commands\IsolatedCommandBase.cs:line 49
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.IsolatedCommandBase1.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NSwag.Commands.IsolatedSwaggerOutputCommandBase.d__4.MoveNext() in C:\projects\nswag\src\NSwag.Commands\Commands\IsolatedSwaggerOutputCommandBase.cs:line 24
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NSwag.Commands.NSwagDocumentBase.d__40.MoveNext() in C:\projects\nswag\src\NSwag.Commands\NSwagDocumentBase.cs:line 266
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NSwag.Commands.NSwagDocument.d__4.MoveNext() in C:\projects\nswag\src\NSwag.Commands\NSwagDocument.cs:line 76
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NSwag.Commands.Document.ExecuteDocumentCommand.d__9.MoveNext() in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 77
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NSwag.Commands.Document.ExecuteDocumentCommand.d__8.MoveNext() in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 31
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NConsole.CommandLineProcessor.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NConsole.CommandLineProcessor.d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
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 54

Can you confirm that it is now working again?

It's now working for me, with both petstore JSON and our JSON, whether I press Create local Copy before Generate Outputs or not. Thanks.

It's working for me also!

Unfortunately it is not working for me. I'm still getting the following. Must be a different cause to the above just on the same version so I'll start a new issue:

System.MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute..ctor(Int32)'.

Was this page helpful?
0 / 5 - 0 ratings