Created
May 23, 2019 13:28
-
-
Save vmandic/b590744cce2c1aec35c7e7f1bfbccff0 to your computer and use it in GitHub Desktop.
meds-processor, part/4, snippet #18
This file contains hidden or 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
services.AddSwaggerGen(opts => | |
{ | |
opts.SwaggerDoc( | |
"v1-0", | |
new Info | |
{ | |
Title = "HZZO meds-processor v1.0", | |
Version = "1.0" | |
}); | |
// Setup swagger to use msbuild documentation: | |
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; | |
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); | |
opts.IncludeXmlComments(xmlPath); | |
opts.AddSecurityDefinition("Bearer", new ApiKeyScheme | |
{ | |
In = "header", | |
Description = "Please insert JWT with Bearer into field", | |
Name = "Authorization", | |
Type = "apiKey" | |
}); | |
opts.AddSecurityRequirement(new Dictionary<string, IEnumerable<string>> | |
{ { "Bearer", new string[] { } } | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment