Skip to content

Commit 3fc0719

Browse files
Rick-Andersoncommonsensesoftware
authored andcommitted
use IsDevelopment
1 parent 99e527f commit 3fc0719

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

examples/AspNetCore/OData/SomeODataOpenApiExample/Program.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@
6868
{
6969
app.UseSwaggerUI(
7070
options =>
71-
{
72-
var descriptions = app.DescribeApiVersions();
73-
74-
// build a swagger endpoint for each discovered API version
75-
foreach ( var description in descriptions )
76-
{
77-
var url = $"/swagger/{description.GroupName}/swagger.json";
78-
var name = description.GroupName.ToUpperInvariant();
79-
options.SwaggerEndpoint( url, name );
80-
}
81-
} );
71+
{
72+
var descriptions = app.DescribeApiVersions();
73+
74+
// build a swagger endpoint for each discovered API version
75+
foreach ( var description in descriptions )
76+
{
77+
var url = $"/swagger/{description.GroupName}/swagger.json";
78+
var name = description.GroupName.ToUpperInvariant();
79+
options.SwaggerEndpoint( url, name );
80+
}
81+
} );
8282
}
8383
app.UseHttpsRedirection();
8484
app.UseAuthorization();

examples/AspNetCore/WebApi/OpenApiExample/Program.cs

+12-12
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@
6060
if ( app.Environment.IsDevelopment() )
6161
{
6262
app.UseSwaggerUI(
63-
options =>
64-
{
65-
var descriptions = app.DescribeApiVersions();
66-
67-
// build a swagger endpoint for each discovered API version
68-
foreach ( var description in descriptions )
69-
{
70-
var url = $"/swagger/{description.GroupName}/swagger.json";
71-
var name = description.GroupName.ToUpperInvariant();
72-
options.SwaggerEndpoint( url, name );
73-
}
74-
} );
63+
options =>
64+
{
65+
var descriptions = app.DescribeApiVersions();
66+
67+
// build a swagger endpoint for each discovered API version
68+
foreach ( var description in descriptions )
69+
{
70+
var url = $"/swagger/{description.GroupName}/swagger.json";
71+
var name = description.GroupName.ToUpperInvariant();
72+
options.SwaggerEndpoint( url, name );
73+
}
74+
} );
7575
}
7676

7777
app.UseHttpsRedirection();

0 commit comments

Comments
 (0)