Пример #1
0
        private static void RegisterSwashBuckle(HttpConfiguration config)
        {
            config
            .EnableSwagger(c =>
            {
                c.SingleApiVersion("3.0", "Roadkill Web API");

                var applyApiKeySecurity = new SwashbuckleApplyApiKeySecurity(
                    key: ApiKeyAuthorizeAttribute.APIKEY_HEADER_KEY,
                    name: ApiKeyAuthorizeAttribute.APIKEY_HEADER_KEY,
                    description: "API key",
                    @in: "header"
                    );
                applyApiKeySecurity.Apply(c);
            })
            .EnableSwaggerUi();
        }
Пример #2
0
		private static void RegisterSwashBuckle(HttpConfiguration config)
		{
			config
				.EnableSwagger(c =>
				{
					c.SingleApiVersion("3.0", "Roadkill Web API");

					var applyApiKeySecurity = new SwashbuckleApplyApiKeySecurity(
					key: ApiKeyAuthorizeAttribute.APIKEY_HEADER_KEY,
					name: ApiKeyAuthorizeAttribute.APIKEY_HEADER_KEY,
					description: "API key",
					@in: "header"
					);
					applyApiKeySecurity.Apply(c);
				})
				.EnableSwaggerUi();
		}