asp.net-core – 找不到Swashbuckle.AspNetCore SwaggerOperation属性
发布时间:2020-10-19 07:08:04 所属栏目:asp.Net 来源:互联网
导读:我正在尝试使用Swashbuckle.AspNetCore(3.0.0)帮助创建的Autorest和Swagger文档来生成REST API客户端. 生成的swagger文档似乎是正确的,除了操作名称不是很好. /api/Addresses/{id}: { get: { tags: [ Address ], operationId:
我正在尝试使用Swashbuckle.AspNetCore(3.0.0)帮助创建的Autorest和Swagger文档来生成REST API客户端. 生成的swagger文档似乎是正确的,除了操作名称不是很好. "/api/Addresses/{id}": { "get": { "tags": [ "Address" ],"operationId": "ApiAddressesByIdGet","consumes": [],"produces": [],"parameters": [ { "name": "id","in": "path","required": true,"type": "string","format": "uuid" } ],"responses": { "200": { "description": "Success" } } }, 我在许多文章和SwashBuckle.AspNetCore的官方文档中看到我可以使用属性来装饰我的控制器方法,如下所示: [HttpGet] [Produces("application/json")] [ProducesResponseType((int)HttpStatusCode.NotFound)] [ProducesResponseType(typeof(List<AddressDto>),(int)HttpStatusCode.OK)] [SwaggerOperation("GetAllAdresses")] public async Task<IActionResult> GetAllAsync() { .... } 不幸的是,我收到了一个错误:无法找到SwaggerOperationAttribute! 我验证了安装的nuget包,它们是: > SwashBuckle.AspNetCore.Swagger(3.0.0) 有人可以帮帮我吗?请 解决方法我今天碰到了这个.我需要添加以下为V3.0.0添加的nuget包:Swashbuckle.AspNetCore.Annotations 突破性变化描述于here (编辑:岳阳站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc-3 – System.Web.Mvc.HandleErrorInfo错误的模
- asp.net 使用驻留在页面中的Cache缓存常用可定时更新的数据
- asp.net-mvc – ASP.NET MVC:添加将DisplayName合并到自定
- asp.net-mvc – 找到相同类型的两个实体之间的差异
- asp.net-core – 构建asp.net核心错误
- asp.net-mvc – 如何在asp.net mvc3项目中开始使用openID?
- asp.net-core – .NET Core SDK安装程序无法在Windows 2012
- RSS2.0中文规范详解及示例
- asp.net – 我可以愚弄HttpRequest.Current.Request.IsLoca
- asp.net – 未知的服务器标签’ajaxToolkit:CalendarExten
推荐文章
站长推荐
- asp.net通过Ajax UpdatePanel回传后滚动条位置变
- 如何在asp.net应用程序中找到i / o瓶颈
- asp.net-mvc – 获取ControllerName和ActionName
- asp.net – 脚本标签和链接标签进入asp:内容或外
- asp.net-mvc-3 – 局部视图中的RenderSection
- asp.net-mvc – 如何在视图上下文之外获取ModelM
- asp.net-mvc – 在MVC ActionLink中使用Knockout
- 从ASP.NET应用程序使用Active Directory时,Direc
- asp.net-mvc – 使用jQuery.post将多个参数发布到
- 实现ASP.NET多文件上传程序代码
热点阅读