Skip to content

Commit

Permalink
Adds OperationSecurityScopeProcessor to NSwag.Sample.NETCore20. (#1894)
Browse files Browse the repository at this point in the history
  • Loading branch information
pekspro authored and RicoSuter committed Jan 18, 2019
1 parent 6030cfe commit e3a94b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/NSwag.Sample.NETCore20/Startup.cs
Expand Up @@ -31,13 +31,15 @@ public void ConfigureServices(IServiceCollection services)
.AddSwaggerDocument(document =>
{
document.DocumentName = "swagger";
// Add operation security scope processor
document.OperationProcessors.Add(new OperationSecurityScopeProcessor("TEST_APIKEY"));
// Add custom document processors, etc.
document.DocumentProcessors.Add(new SecurityDefinitionAppender("TEST_HEADER", new SwaggerSecurityScheme
document.DocumentProcessors.Add(new SecurityDefinitionAppender("TEST_APIKEY", new SwaggerSecurityScheme
{
Type = SwaggerSecuritySchemeType.ApiKey,
Name = "TEST_HEADER",
In = SwaggerSecurityApiKeyLocation.Header,
Description = "TEST_HEADER"
Description = "TEST_DESCRIPTION"
}));
// Post process the generated document
document.PostProcess = d => d.Info.Title = "Hello world!";
Expand Down

0 comments on commit e3a94b5

Please sign in to comment.