@@ -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 }
0 commit comments