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.

"System.InvalidOperationException: TODO:" (Not a JArray issue?)

See original GitHub issue

Version 5.0.0-rc2

I have some big complex objects. It’s not clear to me what SwashBuckle was doing at the time. Maybe a good first step would be to make the exception more clear, to help all of us?

I’m making an assumption that this is not a JArray issue because as far as I know, I’m not using Newtonsoft anywhere in this project. However, I tried NSwag and that’s given me an error saying it can’t load file or assembly Microsoft.AspNetCore.Mvc.NewtonsoftJson.

info: Microsoft.AspNetCore.Hosting.Diagnostics[1] Request starting HTTP/2 GET https://localhost:5001/swagger/v1/swagger.json
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. System.InvalidOperationException: TODO: at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ArraySchemaGenerator.GenerateSchemaFor(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ObjectSchemaGenerator.GeneratePropertySchema(JsonProperty jsonProperty, Object[] attributes, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ObjectSchemaGenerator.GenerateSchemaFor(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ReferencedSchemaGenerator.GenerateSchemaFor(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.ChainableSchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateResponseMediaType(Type type, SchemaRepository schemaRespository) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.<>c__DisplayClass19_0.<GenerateResponse>b__2(String contentType) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateResponse(String statusCode, ApiResponseType apiResponseType, IEnumerable1 methodAttributes, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateResponses(ApiDescription apiDescription, IEnumerable1 methodAttributes, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperation(ApiDescription apiDescription, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable1 apiDescriptions, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
domaindrivendevcommented, Sep 17, 2019

So that’s the latest pre-release version but not the latest preview version. Preview versions are generated with every commit to master and hosted on myget.org. See https://www.myget.org/feed/domaindrivendev/package/nuget/Swashbuckle.AspNetCore.

Confusing terminology I know 😃 FWIW, I’m aiming to get the next pre-release (5.0.0-rc3) out very shortly, closely followed by the official 5.0.0 release. But in the meantime, you’ll need to live on the edge with the preview versions 😨

0reactions
voroninpcommented, Sep 17, 2019

<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc2" />

Yep, removed bin and obj folders, deleted all swashbuckle packages from .nuget folder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add JObject to JArray on nth position
When I try to add a placeholderVm to my JArray, it works fine the first time, but on the 2nd iteration it throws...
Read more >
How to Get Data from JSON Array in .NET C#?
Learn how to retrieve data from a JSON array in .NET C# using the Newtonsoft.Json library. Easily access and iterate through nested data....
Read more >
Deserialize json array not Working - Studio
my json file below, when I try to deserialize it to an array I receive the error : Deserialize json array : Error...
Read more >
How to Convert JSON Array to JSON Object in .NET C#? - ...
Below is the complete code that will parse the JSON Array and iterate over all the JSON objects in the array and get...
Read more >
C# (CSharp) Newtonsoft.Json.Linq.JArray Examples
JArray - 44 examples found. These are the top rated real world C# (CSharp) examples of Newtonsoft.Json.Linq.JArray extracted from open source projects.
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