{"action":"closed","issue":{"url":"https://api.github.com/repos/NSwag/NSwag/issues/156","repository_url":"https://api.github.com/repos/NSwag/NSwag","labels_url":"https://api.github.com/repos/NSwag/NSwag/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/NSwag/NSwag/issues/156/comments","events_url":"https://api.github.com/repos/NSwag/NSwag/issues/156/events","html_url":"https://github.com/NSwag/NSwag/issues/156","id":158715651,"number":156,"title":"System.InvalidOperationException: Could not find item type of array type 'Newtonsoft.Json.Linq.JToken'","user":{"login":"csnyded3","id":19781545,"avatar_url":"https://avatars.githubusercontent.com/u/19781545?v=3","gravatar_id":"","url":"https://api.github.com/users/csnyded3","html_url":"https://github.com/csnyded3","followers_url":"https://api.github.com/users/csnyded3/followers","following_url":"https://api.github.com/users/csnyded3/following{/other_user}","gists_url":"https://api.github.com/users/csnyded3/gists{/gist_id}","starred_url":"https://api.github.com/users/csnyded3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csnyded3/subscriptions","organizations_url":"https://api.github.com/users/csnyded3/orgs","repos_url":"https://api.github.com/users/csnyded3/repos","events_url":"https://api.github.com/users/csnyded3/events{/privacy}","received_events_url":"https://api.github.com/users/csnyded3/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NSwag/NSwag/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2016-06-06T16:10:47Z","updated_at":"2016-08-24T19:14:49Z","closed_at":"2016-08-24T19:14:49Z","body":"I'm trying to generate a swagger specification based on a ASP.NET Web API controller assembly. However, whenever I try to generate the specification, I get the following exception:\r\n\r\n```\r\nSystem.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Could not find item type of array type 'Newtonsoft.Json.Linq.JToken'.\r\n\r\nServer stack trace:\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](Type type, JsonSchema4 rootSchema, IEnumerable`1 parentAttributes, ISchemaDefinitionAppender schemaDefinitionAppender,ISchemaResolver schemaResolver)\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](Type type, JsonSchema4 rootSchema, IEnumerable`1 parentAttributes, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.LoadProperty(Type parentType, PropertyInfo property, JsonSchema4 parentSchema, JsonSchema4 rootSchema, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.GeneratePropertiesAndInheritance(Type type, JsonSchema4 schema, JsonSchema4 rootSchema, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateObject[TSchemaType](Type type, TSchemaType schema, JsonSchema4 rootSchema, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NSwag.CodeGeneration.SwaggerGenerators.RootTypeJsonSchemaGenerator.GenerateObject[TSchemaType](Type type, TSchemaType schema, JsonSchema4 rootSchema, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\RootTypeJsonSchemaGenerator.cs:line 45\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](Type type, JsonSchema4 rootSchema, IEnumerable`1 parentAttributes, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.CreateAndAddSchema(SwaggerService service, Type type, Boolean mayBeNull, IEnumerable`1 parentAttributes, ISchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 575\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.CreateBodyParameter(SwaggerService service, ParameterInfo parameter, ISchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 422\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.LoadParameters(SwaggerService service, SwaggerOperation operation, List`1 parameters, ISchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 324\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.GenerateForController(SwaggerService service, Type controllerType, String excludedMethodName, SchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 108\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.GenerateForControllers(IEnumerable`1 controllerTypes, String excludedMethodName)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 72\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiAssemblyToSwaggerGenerator.WebApiAssemblyLoader.GenerateForControllers(IEnumerable`1 controllerClassNames, String settingsData)\r\nin C:\\projects\\nswag\\src\\NSwag.AssemblyLoader\\SwaggerGenerators\\WebApi\\WebApiAssemblyToSwaggerGenerator.cs:line 92\r\n   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)\r\n   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)\r\n\r\nException rethrown at [0]:\r\n   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiAssemblyToSwaggerGenerator.WebApiAssemblyLoader.GenerateForControllers(IEnumerable`1 controllerClassNames, String settingsData)\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiAssemblyToSwaggerGenerator.GenerateForControllers(IEnumerable`1 controllerClassNames)\r\nin C:\\projects\\nswag\\src\\NSwag.AssemblyLoader\\SwaggerGenerators\\WebApi\\WebApiAssemblyToSwaggerGenerator.cs:line 65\r\n   at NSwag.Commands.WebApiToSwaggerCommand.<RunAsync>b__35_0()\r\nin C:\\projects\\nswag\\src\\NSwag\\Commands\\WebApiToSwaggerCommand.cs:line 111\r\n   at System.Threading.Tasks.Task`1.InnerInvoke()\r\n   at System.Threading.Tasks.Task.Execute()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NSwag.Commands.WebApiToSwaggerCommand.<RunAsync>d__35.MoveNext()\r\nin C:\\projects\\nswag\\src\\NSwag\\Commands\\WebApiToSwaggerCommand.cs:line 99\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NSwag.Commands.WebApiToSwaggerCommand.<RunAsync>d__34.MoveNext()\r\nin C:\\projects\\nswag\\src\\NSwag\\Commands\\WebApiToSwaggerCommand.cs:line 91\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NConsole.CommandLineProcessor.<ProcessSingleAsync>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NConsole.CommandLineProcessor.<ProcessAsync>d__8.MoveNext()\r\n   --- End of inner exception stack trace ---\r\n   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\r\n   at System.Threading.Tasks.Task`1.get_Result()\r\n   at NSwag.Program.Main(String[] args)\r\nin C:\\projects\\nswag\\src\\NSwag\\Program.cs:line 13\r\n---> (Inner Exception #0) System.InvalidOperationException: Could not find item type of array type 'Newtonsoft.Json.Linq.JToken'.\r\n\r\nServer stack trace:\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](Type type, JsonSchema4 rootSchema, IEnumerable`1 parentAttributes, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](Type type, JsonSchema4 rootSchema, IEnumerable`1 parentAttributes, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.LoadProperty(Type parentType, PropertyInfo property, JsonSchema4 parentSchema, JsonSchema4 rootSchema, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.GeneratePropertiesAndInheritance(Type type, JsonSchema4 schema, JsonSchema4 rootSchema, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateObject[TSchemaType](Type type, TSchemaType schema, JsonSchema4 rootSchema, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NSwag.CodeGeneration.SwaggerGenerators.RootTypeJsonSchemaGenerator.GenerateObject[TSchemaType](Type type, TSchemaType schema, JsonSchema4 rootSchema, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\RootTypeJsonSchemaGenerator.cs:line 45\r\n   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](Type type, JsonSchema4 rootSchema, IEnumerable`1 parentAttributes, ISchemaDefinitionAppender schemaDefinitionAppender, ISchemaResolver schemaResolver)\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.CreateAndAddSchema(SwaggerService service, Type type, Boolean mayBeNull, IEnumerable`1 parentAttributes, ISchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 575\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.CreateBodyParameter(SwaggerService service, ParameterInfo parameter, ISchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 422\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.LoadParameters(SwaggerService service, SwaggerOperation operation, List`1 parameters, ISchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 324\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.GenerateForController(SwaggerService service, Type controllerType, String excludedMethodName, SchemaResolver schemaResolver)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 108\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGenerator.GenerateForControllers(IEnumerable`1 controllerTypes, String excludedMethodName)\r\nin C:\\projects\\nswag\\src\\NSwag.CodeGeneration\\SwaggerGenerators\\WebApi\\WebApiToSwaggerGenerator.cs:line 72\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiAssemblyToSwaggerGenerator.WebApiAssemblyLoader.GenerateForControllers(IEnumerable`1 controllerClassNames, String settingsData)\r\nin C:\\projects\\nswag\\src\\NSwag.AssemblyLoader\\SwaggerGenerators\\WebApi\\WebApiAssemblyToSwaggerGenerator.cs:line 92\r\n   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)\r\n   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)\r\n\r\nException rethrown at [0]:\r\n   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiAssemblyToSwaggerGenerator.WebApiAssemblyLoader.GenerateForControllers(IEnumerable`1 controllerClassNames, String settingsData)\r\n   at NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiAssemblyToSwaggerGenerator.GenerateForControllers(IEnumerable`1 controllerClassNames)\r\nin C:\\projects\\nswag\\src\\NSwag.AssemblyLoader\\SwaggerGenerators\\WebApi\\WebApiAssemblyToSwaggerGenerator.cs:line 65\r\n   at NSwag.Commands.WebApiToSwaggerCommand.<RunAsync>b__35_0()\r\nin C:\\projects\\nswag\\src\\NSwag\\Commands\\WebApiToSwaggerCommand.cs:line 111\r\n   at System.Threading.Tasks.Task`1.InnerInvoke()\r\n   at System.Threading.Tasks.Task.Execute()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NSwag.Commands.WebApiToSwaggerCommand.<RunAsync>d__35.MoveNext()\r\nin C:\\projects\\nswag\\src\\NSwag\\Commands\\WebApiToSwaggerCommand.cs:line 99\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NSwag.Commands.WebApiToSwaggerCommand.<RunAsync>d__34.MoveNext()\\\r\nin C:\\projects\\nswag\\src\\NSwag\\Commands\\WebApiToSwaggerCommand.cs:line 91\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NConsole.CommandLineProcessor.<ProcessSingleAsync>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NConsole.CommandLineProcessor.<ProcessAsync>d__8.MoveNext()<---\r\n```\r\n\r\nI am able to generate a swagger specification for a simple sample Web API site that I created just to try things out. But, when I move to the full controller assembly, it fails."}}
{"actor":{"display_login":"rsuter"}}