示例#1
0
        private SyntaxTree CreateOpenApiTree(string newAssemblyNamespace, DirectoryInfo directoryInfo)
        {
            if (OpenApiOutputModel != null && OpenApiOutputModel.IsConfiguredForUserInterface)
            {
                string templateSource = TemplateProvider.GetTemplate("swaggerui", "csharp");
                return(CreateSyntaxTreeFromHandlebarsTemplate(templateSource, "SwaggerUi", new
                {
                    Namespace = newAssemblyNamespace
                }, directoryInfo));
            }

            return(null);
        }
示例#2
0
        private SyntaxTree CreateReDocTree(string newAssemblyNamespace, DirectoryInfo directoryInfo)
        {
            if (OpenApiOutputModel != null && !string.IsNullOrWhiteSpace(OpenApiOutputModel.ReDocUserInterfaceRoute))
            {
                string templateSource = TemplateProvider.GetTemplate("redocui", "csharp");
                return(CreateSyntaxTreeFromHandlebarsTemplate(templateSource, "ReDocUi", new
                {
                    Namespace = newAssemblyNamespace,
                    ReDocUserInterfaceRoute = OpenApiOutputModel.ReDocUserInterfaceRoute
                }, directoryInfo));
            }

            return(null);
        }