Example #1
0
        public static async Task <IActionResult> Swagger(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "swagger")]
            HttpRequest req,
            ILogger log)
        {
            var generator  = new AzureFunctionsV2ToSwaggerGenerator(SwaggerConfiguration.SwaggerGeneratorSettings);
            var swaggerDoc = await generator.GenerateForAzureFunctionClassAsync(typeof(HttpExtensionFunctions));

            var json = swaggerDoc.ToJson();

            return(new OkObjectResult(json));
        }
        public static async Task <IActionResult> Swagger(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "swagger")]
            HttpRequest req,
            ILogger log)
        {
            var settings = new AzureFunctionsV2ToSwaggerGeneratorSettings()
            {
                Title       = "My Function App Swagger",
                Description = "Here be dragons!",
                Version     = "1.0"
            };
            var generator  = new AzureFunctionsV2ToSwaggerGenerator(settings);
            var swaggerDoc = await generator.GenerateForAzureFunctionClassAsync(typeof(ExampleFunctions));

            var json = swaggerDoc.ToJson();

            return(new OkObjectResult(json));
        }