Last active
December 20, 2019 04:14
-
-
Save shekcon/d0308850a4e51cf341bcb6462cf39f81 to your computer and use it in GitHub Desktop.
[Swagger 5.0.0 ] ASP.Net #C# #ASP.net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version 5 of swagger example | |
c.SwaggerDoc("v1", new OpenApiInfo | |
{ | |
Title = "Customer Rating API", | |
Description = "API docs for Customer Rating system", | |
Contact = new OpenApiContact | |
{ | |
Name = "Nguyen Kim", | |
Email = string.Empty, | |
Url = new Uri("https://nguyenkim.com"), | |
} | |
}); | |
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme | |
{ | |
Description = "Example: \"Authorization: Bearer {token}\"", | |
Name = "Authorization", | |
In = ParameterLocation.Header, | |
Type = SecuritySchemeType.ApiKey | |
}); | |
c.AddSecurityRequirement(new OpenApiSecurityRequirement { | |
{ new OpenApiSecurityScheme { | |
Reference = new OpenApiReference { | |
Type = ReferenceType.SecurityScheme, Id = "Bearer" | |
} | |
}, new string[] { } } }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment