File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -22,16 +22,19 @@ public class SwaggerOptions
22
22
public Action < SwaggerUiSettings > Configure { get ; set ; }
23
23
public IList < IDocumentProcessor > DocumentProcessors { get ; set ; } = new List < IDocumentProcessor > ( ) ;
24
24
25
- public void AddAuthorizationHeader ( )
25
+ public SwaggerOptions ( bool includeAuthorizationHeader = true )
26
26
{
27
- DocumentProcessors . Add (
28
- new SecurityDefinitionAppender ( "Authorization" , new SwaggerSecurityScheme
29
- {
30
- Type = SwaggerSecuritySchemeType . ApiKey ,
31
- Name = "Authorization" ,
32
- In = SwaggerSecurityApiKeyLocation . Header
33
- } )
34
- ) ;
27
+ if ( includeAuthorizationHeader )
28
+ {
29
+ DocumentProcessors . Add (
30
+ new SecurityDefinitionAppender ( "Authorization" , new SwaggerSecurityScheme
31
+ {
32
+ Type = SwaggerSecuritySchemeType . ApiKey ,
33
+ Name = "Authorization" ,
34
+ In = SwaggerSecurityApiKeyLocation . Header
35
+ } )
36
+ ) ;
37
+ }
35
38
}
36
39
}
37
40
}
Original file line number Diff line number Diff line change @@ -150,11 +150,6 @@ protected virtual void ConfigureLogging(LoggerConfiguration loggerConfiguration)
150
150
151
151
}
152
152
153
- protected virtual void ConfigureSwaggerUi ( SwaggerUiSettings swaggerUiOptions )
154
- {
155
-
156
- }
157
-
158
153
protected virtual void ConfigureDashboardOptions ( DashboardOptions dashboardOptions )
159
154
{
160
155
You can’t perform that action at this time.
0 commit comments