You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turns out if the XML documentation has a param element specified but there are no parameters defined in the action, it blows up.
Example :-
/// <summary>
/// Gets basic profile data of logged-in user
/// </summary>
/// <param></param>
/// <returns></returns>
[HttpGet]
public async Task<ApiResponse<VM.UserInfo>> Info()
Exception :-
Value cannot be null. Parameter name: source ---> System.ArgumentNullException: Value cannot be null. Parameter name: source
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Swashbuckle.Swagger.Filters.ApplyXmlActionComments.ApplyParamComments(Operation operation, XPathNavigator methodNode) in c:\Users\Joel\Documents\GitHub\Swashbuckle\Swashbuckle.Core\Swagger\Filters\ApplyXmlActionComments.cs:line 70
at Swashbuckle.Swagger.Filters.ApplyXmlActionComments.Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) in c:\Users\Joel\Documents\GitHub\Swashbuckle\Swashbuckle.Core\Swagger\Filters\ApplyXmlActionComments.cs:line 40
at Swashbuckle.Swagger.SwaggerGenerator.CreateOperation(ApiDescription apiDescription, SchemaRegistry schemaRegistry) in c:\Users\Joel\Documents\GitHub\Swashbuckle\Swashbuckle.Core\Swagger\SwaggerGenerator.cs:line 153
at Swashbuckle.Swagger.SwaggerGenerator.CreatePathItem(IEnumerable`1 apiDescriptions, SchemaRegistry schemaRegistry) in c:\Users\Joel\Documents\GitHub\Swashbuckle\Swashbuckle.Core\Swagger\SwaggerGenerator.cs:line 97
at Swashbuckle.Swagger.SwaggerGenerator.<>c__DisplayClass7.<GetSwagger>b__4(IGrouping`2 group) in c:\Users\Joel\Documents\GitHub\Swashbuckle\Swashbuckle.Core\Swagger\SwaggerGenerator.cs:line 48
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at Swashbuckle.Swagger.SwaggerGenerator.GetSwagger(String rootUrl, String apiVersion) in c:\Users\Joel\Documents\GitHub\Swashbuckle\Swashbuckle.Core\Swagger\SwaggerGenerator.cs:line 44
at Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in c:\Users\Joel\Documents\GitHub\Swashbuckle\Swashbuckle.Core\Application\SwaggerDocsHandler.cs:line 32
at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()
Joel
The text was updated successfully, but these errors were encountered:
Hi again,
Turns out if the XML documentation has a param element specified but there are no parameters defined in the action, it blows up.
Example :-
Exception :-
Joel
The text was updated successfully, but these errors were encountered: