Skip to content

Commit 1e2ff96

Browse files
Chris Martinezcommonsensesoftware
authored andcommitted
Remove excessive indentation
1 parent 18f96e3 commit 1e2ff96

File tree

2 files changed

+59
-61
lines changed

2 files changed

+59
-61
lines changed

samples/webapi/SwaggerODataWebApiSample/Startup.cs

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ namespace Microsoft.Examples
55
using global::Owin;
66
using Microsoft.AspNet.OData;
77
using Microsoft.AspNet.OData.Builder;
8-
using Microsoft.AspNet.OData.Query;
98
using Microsoft.AspNet.OData.Routing;
109
using Microsoft.Examples.Configuration;
11-
using Microsoft.Examples.Models;
1210
using Microsoft.OData;
1311
using Microsoft.OData.UriParser;
1412
using Newtonsoft.Json.Serialization;
@@ -87,38 +85,38 @@ public void Configuration( IAppBuilder builder )
8785
} );
8886

8987
configuration.EnableSwagger(
90-
"{apiVersion}/swagger",
91-
swagger =>
92-
{
93-
// build a swagger document and endpoint for each discovered API version
94-
swagger.MultipleApiVersions(
95-
( apiDescription, version ) => apiDescription.GetGroupName() == version,
96-
info =>
97-
{
98-
foreach ( var group in apiExplorer.ApiDescriptions )
99-
{
100-
var description = "A sample application with Swagger, Swashbuckle, OData, and API versioning.";
101-
102-
if ( group.IsDeprecated )
103-
{
104-
description += " This API version has been deprecated.";
105-
}
106-
107-
info.Version( group.Name, $"Sample API {group.ApiVersion}" )
108-
.Contact( c => c.Name( "Bill Mei" ).Email( "bill.mei@somewhere.com" ) )
109-
.Description( description )
110-
.License( l => l.Name( "MIT" ).Url( "https://opensource.org/licenses/MIT" ) )
111-
.TermsOfService( "Shareware" );
112-
}
113-
} );
114-
115-
// add a custom operation filter which documents the implicit API version parameter
116-
swagger.OperationFilter<SwaggerDefaultValues>();
117-
118-
// integrate xml comments
119-
swagger.IncludeXmlComments( XmlCommentsFilePath );
120-
} )
121-
.EnableSwaggerUi( swagger => swagger.EnableDiscoveryUrlSelector() );
88+
"{apiVersion}/swagger",
89+
swagger =>
90+
{
91+
// build a swagger document and endpoint for each discovered API version
92+
swagger.MultipleApiVersions(
93+
( apiDescription, version ) => apiDescription.GetGroupName() == version,
94+
info =>
95+
{
96+
foreach ( var group in apiExplorer.ApiDescriptions )
97+
{
98+
var description = "A sample application with Swagger, Swashbuckle, OData, and API versioning.";
99+
100+
if ( group.IsDeprecated )
101+
{
102+
description += " This API version has been deprecated.";
103+
}
104+
105+
info.Version( group.Name, $"Sample API {group.ApiVersion}" )
106+
.Contact( c => c.Name( "Bill Mei" ).Email( "bill.mei@somewhere.com" ) )
107+
.Description( description )
108+
.License( l => l.Name( "MIT" ).Url( "https://opensource.org/licenses/MIT" ) )
109+
.TermsOfService( "Shareware" );
110+
}
111+
} );
112+
113+
// add a custom operation filter which documents the implicit API version parameter
114+
swagger.OperationFilter<SwaggerDefaultValues>();
115+
116+
// integrate xml comments
117+
swagger.IncludeXmlComments( XmlCommentsFilePath );
118+
} )
119+
.EnableSwaggerUi( swagger => swagger.EnableDiscoveryUrlSelector() );
122120

123121
builder.UseWebApi( httpServer );
124122
}

samples/webapi/SwaggerWebApiSample/Startup.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,38 +45,38 @@ public void Configuration( IAppBuilder builder )
4545
} );
4646

4747
configuration.EnableSwagger(
48-
"{apiVersion}/swagger",
49-
swagger =>
48+
"{apiVersion}/swagger",
49+
swagger =>
50+
{
51+
// build a swagger document and endpoint for each discovered API version
52+
swagger.MultipleApiVersions(
53+
( apiDescription, version ) => apiDescription.GetGroupName() == version,
54+
info =>
55+
{
56+
foreach ( var group in apiExplorer.ApiDescriptions )
5057
{
51-
// build a swagger document and endpoint for each discovered API version
52-
swagger.MultipleApiVersions(
53-
( apiDescription, version ) => apiDescription.GetGroupName() == version,
54-
info =>
55-
{
56-
foreach ( var group in apiExplorer.ApiDescriptions )
57-
{
58-
var description = "A sample application with Swagger, Swashbuckle, and API versioning.";
58+
var description = "A sample application with Swagger, Swashbuckle, and API versioning.";
5959

60-
if ( group.IsDeprecated )
61-
{
62-
description += " This API version has been deprecated.";
63-
}
60+
if ( group.IsDeprecated )
61+
{
62+
description += " This API version has been deprecated.";
63+
}
6464

65-
info.Version( group.Name, $"Sample API {group.ApiVersion}" )
66-
.Contact( c => c.Name( "Bill Mei" ).Email( "bill.mei@somewhere.com" ) )
67-
.Description( description )
68-
.License( l => l.Name( "MIT" ).Url( "https://opensource.org/licenses/MIT" ) )
69-
.TermsOfService( "Shareware" );
70-
}
71-
} );
65+
info.Version( group.Name, $"Sample API {group.ApiVersion}" )
66+
.Contact( c => c.Name( "Bill Mei" ).Email( "bill.mei@somewhere.com" ) )
67+
.Description( description )
68+
.License( l => l.Name( "MIT" ).Url( "https://opensource.org/licenses/MIT" ) )
69+
.TermsOfService( "Shareware" );
70+
}
71+
} );
7272

73-
// add a custom operation filter which sets default values
74-
swagger.OperationFilter<SwaggerDefaultValues>();
73+
// add a custom operation filter which sets default values
74+
swagger.OperationFilter<SwaggerDefaultValues>();
7575

76-
// integrate xml comments
77-
swagger.IncludeXmlComments( XmlCommentsFilePath );
78-
} )
79-
.EnableSwaggerUi( swagger => swagger.EnableDiscoveryUrlSelector() );
76+
// integrate xml comments
77+
swagger.IncludeXmlComments( XmlCommentsFilePath );
78+
} )
79+
.EnableSwaggerUi( swagger => swagger.EnableDiscoveryUrlSelector() );
8080

8181
builder.UseWebApi( httpServer );
8282
}

0 commit comments

Comments
 (0)