小编Mik*_*iky的帖子

使用 --save-exact 的目的是什么

想知道-exactwith的使用--save

npm i typescript@3.4 --save-dev --save-exact
Run Code Online (Sandbox Code Playgroud)

node.js npm npm-install

18
推荐指数
2
解决办法
8806
查看次数

swagger-ui 中默认的 api 版本值

我已经在我们的asp.core wep-api项目中配置了 swagger并且它工作得非常好。现在我正在研究当swagger-ui出现时的解决方案,如下所示

https://imgur.com/a/K7QTKCu

api 版本部分应根据代码端的配置自动填充。

        services.AddSwaggerGen(c =>
        {
            c.SwaggerDoc("v1", new Info
            {
                Version = "v1",
                Title = "My API",
                Contact = new Contact
                {
                    Name = "My Api",
                    Url = "https://109.com/"
                }
            });
            var security = new Dictionary<string, IEnumerable<string>>
            {
                {"Bearer", new string[] { }},
            };
            c.AddSecurityDefinition("Bearer", new ApiKeyScheme
            {
                Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
                Name = "Authorization",
                In = "header",
                Type = "apiKey"
            });
            c.AddSecurityRequirement(security);
        });
Run Code Online (Sandbox Code Playgroud)

c# swagger-ui asp.net-core

7
推荐指数
1
解决办法
4156
查看次数

标签 统计

asp.net-core ×1

c# ×1

node.js ×1

npm ×1

npm-install ×1

swagger-ui ×1