public async Task<string> RunAsync() { var generator = new WebApiAssemblyToSwaggerGenerator(Settings); var service = string.IsNullOrEmpty(ControllerName) ? generator.GenerateForAssemblyControllers() : generator.GenerateForSingleController(ControllerName); return service.ToJson(); }
public async Task<string> GenerateSwaggerAsync() { return await RunTaskAsync(async () => { return await Task.Run(() => { var generator = new WebApiAssemblyToSwaggerGenerator(AssemblyPath, new JsonSchemaGeneratorSettings { DefaultEnumHandling = DefaultEnumHandling }); if (SpecifyControllerName) return generator.GenerateForSingleController(ControllerName, UrlTemplate).ToJson(); else return generator.GenerateForAssemblyControllers(UrlTemplate).ToJson(); }); }); }