@@ -76,7 +76,24 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
76
76
// Swagger - Enable this line and the related lines in Configure method to enable swagger UI
77
77
services . AddSwaggerGen ( options =>
78
78
{
79
- options . SwaggerDoc ( "v1" , new OpenApiInfo ( ) { Title = "AbpProjectName API" , Version = "v1" } ) ;
79
+ options . SwaggerDoc ( "v1" , new OpenApiInfo
80
+ {
81
+ Version = "v1" ,
82
+ Title = "AbpProjectName API" ,
83
+ Description = "AbpProjectName" ,
84
+ // uncomment if needed TermsOfService = new Uri("https://example.com/terms"),
85
+ Contact = new OpenApiContact
86
+ {
87
+ Name = "AbpProjectName" ,
88
+ Email = string . Empty ,
89
+ Url = new Uri ( "https://twitter.com/aspboilerplate" ) ,
90
+ } ,
91
+ License = new OpenApiLicense
92
+ {
93
+ Name = "MIT License" ,
94
+ Url = new Uri ( "https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/LICENSE" ) ,
95
+ }
96
+ } ) ;
80
97
options . DocInclusionPredicate ( ( docName , description ) => true ) ;
81
98
82
99
// Define the BearerAuth scheme that's in use
@@ -128,6 +145,7 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
128
145
options . SwaggerEndpoint ( _appConfiguration [ "App:ServerRootAddress" ] . EnsureEndsWith ( '/' ) + "swagger/v1/swagger.json" , "AbpProjectName API V1" ) ;
129
146
options . IndexStream = ( ) => Assembly . GetExecutingAssembly ( )
130
147
. GetManifestResourceStream ( "AbpCompanyName.AbpProjectName.Web.Host.wwwroot.swagger.ui.index.html" ) ;
148
+ options . DisplayRequestDuration ( ) ; // Controls the display of the request duration (in milliseconds) for "Try it out" requests.
131
149
} ) ; // URL: /swagger
132
150
}
133
151
}
0 commit comments