private void ConfigureSwagger()
        {
            SwaggerMetadataProvider.SetInfo(
                "Shared Terminology Data Services",
                TerminologyVersion.SemanticVersion.ToString(),
                "Shared Terminology Data Services - Fabric.Terminology.API",
                new Contact()
            {
                EmailAddress = "*****@*****.**"
            });

            if (!this.appConfig.SwaggerRootBasePath.IsNullOrWhiteSpace())
            {
                SwaggerMetadataProvider.SetSwaggerRoot(basePath: this.appConfig.SwaggerRootBasePath);
            }
        }
Пример #2
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            SwaggerMetadataProvider.SetInfo("Nancy Swagger Example", "v0", "Our awesome service", new Contact()
            {
                EmailAddress = "*****@*****.**"
            });

            SwaggerMetadataProvider.SetSwaggerRoot(
                externalDocumentation: new ExternalDocumentation {
                Description = "GitHub",
                Url         = "https://github.com/yahehe/Nancy.Swagger"
            },
                schemes: new[] { Schemes.Http }
                );

            base.ApplicationStartup(container, pipelines);

            SwaggerAnnotationsConfig.ShowOnlyAnnotatedRoutes = true;
        }
Пример #3
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            this.Conventions.ViewLocationConventions.Add((viewName, model, context) =>
            {
                return(string.Concat("ui/", viewName));
            });

            SwaggerMetadataProvider.SetInfo(
                title: "OmegaGraf",
                version: Globals.Config.Version,
                desc: "OmegaGraf-Compose",
                contact: new Contact()
            {
                EmailAddress = "*****@*****.**",
                Name         = "Jacob Colvin"
            }
                );

            var securitySchemeBuilder = new ApiKeySecuritySchemeBuilder();

            securitySchemeBuilder.IsInHeader();
            securitySchemeBuilder.Name("Authorization");
            SwaggerMetadataProvider.SetSecuritySchemeBuilder(securitySchemeBuilder, "ApiKey");

            SwaggerMetadataProvider.SetSwaggerRoot(
                externalDocumentation: new ExternalDocumentation
            {
                Description = "GitHub",
                Url         = "https://github.com/OmegaGraf/OmegaGraf"
            },
                schemes: new[] { Schemes.Http, Schemes.Https },
                produces: new[] { "application/json" }
                );

            base.ApplicationStartup(container, pipelines);
        }