.NET Core Web API Swagger 文档生成
REST API 中文档说明,用Swagger都快成了一种规范了,
之前在公司里面就折腾过了, 效果还是很不错的, 不过之前都是维护一个swagger...json/yaml,
后来发现其实可以直接在API实现的地方根据实现来生成swagger在线文档,
拖延症发作的我并没有去管, 这次有个新API在做, 于是折腾了一下....System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Zhihu404API.Dao...using Swashbuckle.AspNetCore.Annotations;
using Newtonsoft.Json.Linq;
using RestSharp;
namespace XX404API.Controllers.../v1/extend-data")]
// 返回值格式会直接序列化这个typeof的类型
[SwaggerResponse(200, "", typeof(int))]