Skip to content

Instantly share code, notes, and snippets.

@mdcarmo mdcarmo/configSwagger.cs
Last active Mar 21, 2018

Embed
What would you like to do?
configuração do swagger método ConfigureServices
services.AddSwaggerGen(c =>
{
c.AddSecurityDefinition(
"Bearer",
new ApiKeyScheme()
{
In = "header",
Description = "Please insert JWT with Bearer into field",
Name = "Authorization",
Type = "apiKey"
});
c.SwaggerDoc("v1", new Info
{
Version = "v1",
Description = "Services Layer for api for blog",
Contact = new Contact { Name = "Marcelo Dias",
Email = "marc29dias@yahoo.com.br",
Url = "www.marcdias.com.br" },
});
var basePath = AppContext.BaseDirectory;
var xmlPath = Path.Combine(basePath, "ApiForBlog.xml");
c.IncludeXmlComments(xmlPath);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.