C# NET MVC-Swagger在使用自定义谓词时引发异常
非常简单的问题: 我的控制器代码:C# NET MVC-Swagger在使用自定义谓词时引发异常,c#,swagger,C#,Swagger,非常简单的问题: 我的控制器代码: [AcceptVerbs("VALIDATE","PUT")] public ObjectResult Validate(BookingState input) { return OK(ImmutableList.Create<object>()); } 如果我删除“VALIDATE”动词,它就可以正常工作 System.
[AcceptVerbs("VALIDATE","PUT")]
public ObjectResult Validate(BookingState input)
{
return OK(ImmutableList.Create<object>());
}
如果我删除“VALIDATE”动词,它就可以正常工作
System.Collections.Generic.KeyNotFoundException: The given key 'VALIDATE' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable`1 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.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)