The settings for UseSwagger.
Inheritance: NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGeneratorSettings
Beispiel #1
0
 /// <summary>Addes the Swagger generator to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="controllerTypes">The Web API controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     IEnumerable <Type> controllerTypes,
     SwaggerOwinSettings settings)
 {
     return(app.UseSwagger(controllerTypes, settings, new SwaggerJsonSchemaGenerator(settings)));
 }
Beispiel #2
0
 public SwaggerMiddleware(RequestDelegate nextDelegate, string path, IEnumerable <Type> controllerTypes, SwaggerOwinSettings settings)
 {
     _nextDelegate    = nextDelegate;
     _path            = path;
     _controllerTypes = controllerTypes;
     _settings        = settings;
 }
Beispiel #3
0
 /// <summary>Addes the Swagger generator and Swagger UI to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="webApiAssembly">The Web API assembly to search for controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     Assembly webApiAssembly,
     SwaggerOwinSettings settings)
 {
     return(app.UseSwagger(new[] { webApiAssembly }, settings));
 }
Beispiel #4
0
 /// <summary>Addes the Swagger generator to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="controllerTypes">The Web API controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     IEnumerable<Type> controllerTypes,
     SwaggerOwinSettings settings)
 {
     return app.UseSwagger(controllerTypes, settings, new SwaggerJsonSchemaGenerator(settings));
 }
Beispiel #5
0
 /// <summary>Addes the Swagger generator and Swagger UI to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="webApiAssembly">The Web API assembly to search for controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     Assembly webApiAssembly,
     SwaggerOwinSettings settings)
 {
     return app.UseSwagger(new[] { webApiAssembly }, settings);
 }
Beispiel #6
0
 /// <summary>Addes the Swagger generator to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="controllerTypes">The Web API controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     IEnumerable<Type> controllerTypes,
     SwaggerOwinSettings settings)
 {
     app.UseMiddleware<SwaggerMiddleware>(settings.ActualSwaggerRoute, controllerTypes, settings);
     return app;
 }
Beispiel #7
0
 /// <summary>Addes the Swagger generator and Swagger UI to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="webApiAssemblies">The Web API assemblies to search for controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     IEnumerable<Assembly> webApiAssemblies,
     SwaggerOwinSettings settings)
 {
     var controllerTypes = webApiAssemblies.SelectMany(WebApiToSwaggerGenerator.GetControllerClasses);
     return app.UseSwagger(controllerTypes, settings);
 }
Beispiel #8
0
 /// <summary>Addes the Swagger generator and Swagger UI to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="webApiAssemblies">The Web API assemblies to search for controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     IEnumerable<Assembly> webApiAssemblies,
     SwaggerOwinSettings settings)
 {
     var controllerTypes = webApiAssemblies.SelectMany(WebApiToSwaggerGenerator.GetControllerClasses);
     return app.UseSwagger(controllerTypes, settings);
 }
Beispiel #9
0
 /// <summary>Addes the Swagger generator to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="controllerTypes">The Web API controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <param name="schemaGenerator">The schema generator.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     IEnumerable <Type> controllerTypes,
     SwaggerOwinSettings settings,
     SwaggerJsonSchemaGenerator schemaGenerator)
 {
     app.UseMiddleware <SwaggerMiddleware>(settings.ActualSwaggerRoute, controllerTypes, settings, schemaGenerator);
     return(app);
 }
Beispiel #10
0
 /// <summary>Addes the Swagger generator to the OWIN pipeline.</summary>
 /// <param name="app">The app.</param>
 /// <param name="controllerTypes">The Web API controller types.</param>
 /// <param name="settings">The Swagger generator settings.</param>
 /// <param name="schemaGenerator">The schema generator.</param>
 /// <returns>The app builder.</returns>
 public static IApplicationBuilder UseSwagger(
     this IApplicationBuilder app,
     IEnumerable<Type> controllerTypes,
     SwaggerOwinSettings settings,
     SwaggerJsonSchemaGenerator schemaGenerator)
 {
     app.UseMiddleware<SwaggerMiddleware>(settings.ActualSwaggerRoute, controllerTypes, settings, schemaGenerator);
     return app;
 }
Beispiel #11
0
        /// <summary>Adds the Swagger generator to the OWIN pipeline.</summary>
        /// <param name="app">The app.</param>
        /// <param name="controllerTypes">The Web API controller types.</param>
        /// <param name="configure">Configure the Swagger generator settings.</param>
        public static IApplicationBuilder UseSwagger(
            this IApplicationBuilder app,
            IEnumerable <Type> controllerTypes,
            Action <SwaggerOwinSettings> configure = null)
        {
            var settings = new SwaggerOwinSettings();

            configure?.Invoke(settings);
            return(app.UseSwagger(controllerTypes, settings, new SwaggerJsonSchemaGenerator(settings)));
        }