rbeauchamp / Swashbuckle.OData

Extends Swashbuckle with OData v4 support!
Other
128 stars 96 forks source link

ODataSwaggerProvider.CreatePathItem throws NullReferenceException #153

Closed corfor closed 4 years ago

corfor commented 7 years ago

I'm using Swashbuckle.OData 3.4.0. Problem comes when also using Microsoft.AspNet.WebApi.Versioning 2.1.0.

Object reference not set to an instance of an object. System.NullReferenceException at Swashbuckle.OData.ODataSwaggerProvider.CreatePathItem(IEnumerable1 apiDescriptions, SchemaRegistry schemaRegistry) in C:\Users\rbeauchamp\Documents\GitHub\Swashbuckle.OData\Swashbuckle.OData\ODataSwaggerProvider.cs:line 155 at Swashbuckle.OData.ODataSwaggerProvider.<>c__DisplayClass5_0.<GenerateSwagger>b__3(IGrouping2 group) in C:\Users\rbeauchamp\Documents\GitHub\Swashbuckle.OData\Swashbuckle.OData\ODataSwaggerProvider.cs:line 83 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, Func`2 elementSelector) at Swashbuckle.OData.ODataSwaggerProvider.GenerateSwagger(String rootUrl, String apiVersion) in C:\Users\rbeauchamp\Documents\GitHub\Swashbuckle.OData\Swashbuckle.OData\ODataSwaggerProvider.cs:line 79 at Swashbuckle.OData.ODataSwaggerProvider.GetSwagger(String rootUrl, String apiVersion) in C:\Users\rbeauchamp\Documents\GitHub\Swashbuckle.OData\Swashbuckle.OData\ODataSwaggerProvider.cs:line 56 at Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Web.Http.HttpServer.d__0.MoveNext()" } http://localhost:63326/swagger/docs/v2