我无法获得Swashbuckle.AspNetCore(1.0.0)包来生成任何输出.我读过swagger.json文件应该写成'〜/ swagger/docs/v1'.但是,我没有得到任何输出.
我从一个全新的ASP.NET Core API项目开始.我应该提到这是ASP.NET Core 2. API工作,我能够从值控制器中检索值就好了.
我的启动类具有完全如本文所述的配置(GitHub上的Swashbuckle.AspNetCore).
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });
});
}
// This method gets called by the runtime. Use this method …Run Code Online (Sandbox Code Playgroud) 我通常使用 Visual Studio 2017 进行编码,但当我使用 Java 或 Python 进行编程时,我使用 Visual Studio Code。
在 Visual Studio 2017 中,智能感知具有过滤器,允许您仅查看参数、方法、片段……使工作变得更加容易。
Visual Studio Code 有智能感知,但没有过滤器,有办法激活它们吗?或者还没有实施?