The settings for UseSwagger.
Inheritance: NSwag.CodeGeneration.SwaggerGenerators.WebApi.WebApiToSwaggerGeneratorSettings
Esempio n. 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)));
 }
Esempio n. 2
0
 public SwaggerMiddleware(RequestDelegate nextDelegate, string path, IEnumerable <Type> controllerTypes, SwaggerOwinSettings settings)
 {
     _nextDelegate    = nextDelegate;
     _path            = path;
     _controllerTypes = controllerTypes;
     _settings        = settings;
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 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)));
        }