File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 2020builder . Logging . ClearProviders ( ) ;
2121builder . Logging . AddConsole ( ) ;
2222
23- builder . Services . AddControllers ( options =>
23+ builder . Services . AddControllers ( options =>
2424 options . SuppressImplicitRequiredAttributeForNonNullableReferenceTypes = true )
2525 . AddNewtonsoftJson ( options =>
2626 options . SerializerSettings . ReferenceLoopHandling = Newtonsoft . Json . ReferenceLoopHandling . Ignore
3939 BearerFormat = "JWT" ,
4040 Scheme = "bearer"
4141 } ) ;
42-
42+
4343 option . OperationFilter < AuthResponsesOperationFilter > ( ) ;
4444} ) ;
4545
7272 }
7373 else if ( dbProvider == "InMemory" )
7474 {
75- options . ConfigureWarnings ( warnOpts => {
75+ options . ConfigureWarnings ( warnOpts =>
76+ {
7677 // InMemory doesn't support transactions and we're ok with it
7778 warnOpts . Ignore ( InMemoryEventId . TransactionIgnoredWarning ) ;
7879 } ) ;
150151
151152app . UseGraphQL ( ) ;
152153
153- app . UseSwagger ( ) ;
154+ app . UseSwagger ( c =>
155+ {
156+ c . PreSerializeFilters . Add ( ( swagger , httpReq ) =>
157+ {
158+ // Adding server base address in the generated file relative to the server's host
159+ swagger . Servers = new List < OpenApiServer > { new OpenApiServer { Url = $ "{ httpReq . Scheme } ://{ httpReq . Host . Value } " } } ;
160+ } ) ;
161+ } ) ;
162+
154163app . UseSwaggerUI ( ) ;
155164app . UseSeedDB ( ) ;
156165
You can’t perform that action at this time.
0 commit comments