Skip to content

Commit

Permalink
use IsDevelopment
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick-Anderson committed Apr 18, 2024
1 parent 464d89b commit 6f5f220
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
22 changes: 11 additions & 11 deletions examples/AspNetCore/OData/SomeODataOpenApiExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@
{
app.UseSwaggerUI(
options =>
{
var descriptions = app.DescribeApiVersions();
// build a swagger endpoint for each discovered API version
foreach ( var description in descriptions )
{
var url = $"/swagger/{description.GroupName}/swagger.json";
var name = description.GroupName.ToUpperInvariant();
options.SwaggerEndpoint( url, name );
}
} );
{
var descriptions = app.DescribeApiVersions();
// build a swagger endpoint for each discovered API version
foreach ( var description in descriptions )
{
var url = $"/swagger/{description.GroupName}/swagger.json";
var name = description.GroupName.ToUpperInvariant();
options.SwaggerEndpoint( url, name );
}
} );
}
app.UseHttpsRedirection();
app.UseAuthorization();
Expand Down
24 changes: 12 additions & 12 deletions examples/AspNetCore/WebApi/OpenApiExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@
if ( app.Environment.IsDevelopment() )
{
app.UseSwaggerUI(
options =>
{
var descriptions = app.DescribeApiVersions();
// build a swagger endpoint for each discovered API version
foreach ( var description in descriptions )
{
var url = $"/swagger/{description.GroupName}/swagger.json";
var name = description.GroupName.ToUpperInvariant();
options.SwaggerEndpoint( url, name );
}
} );
options =>
{
var descriptions = app.DescribeApiVersions();
// build a swagger endpoint for each discovered API version
foreach ( var description in descriptions )
{
var url = $"/swagger/{description.GroupName}/swagger.json";
var name = description.GroupName.ToUpperInvariant();
options.SwaggerEndpoint( url, name );
}
} );
}

app.UseHttpsRedirection();
Expand Down

0 comments on commit 6f5f220

Please sign in to comment.