Initial commit
This commit is contained in:
		| @@ -0,0 +1,15 @@ | ||||
| using System; | ||||
| using GerstITS.Web.Api.Swagger; | ||||
|  | ||||
| namespace GerstITS.Examples.Api.Swagger | ||||
| { | ||||
|     internal class LicenseConfiguration : ILicense | ||||
|     { | ||||
|         #region Properties | ||||
|  | ||||
|         public string Name { get; set; } | ||||
|         public Uri Url { get; set; }  | ||||
|          | ||||
|         #endregion | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,19 @@ | ||||
| using GerstITS.Web.Api.Swagger; | ||||
| using Microsoft.OpenApi.Models; | ||||
|  | ||||
| namespace GerstITS.Examples.Api.Swagger | ||||
| { | ||||
|     internal sealed class SwaggerSecurityConfiguration : IOpenApiSecuritySchemeConfiguration | ||||
|     { | ||||
|         #region Properties | ||||
|  | ||||
|         public bool AllowAnonymous { get; set; } | ||||
|         public string HttpHeaderKey { get; set; } | ||||
|         public string Scheme { get; set; } | ||||
|         public SecuritySchemeType SchemeType { get; set; } | ||||
|         public ParameterLocation ParameterLocation { get; set; } | ||||
|         public string Description { get; set; }  | ||||
|          | ||||
|         #endregion | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,49 @@ | ||||
| using System; | ||||
| using System.Diagnostics; | ||||
| using GerstITS.System.Configurations; | ||||
| using GerstITS.Web.Api.Swagger; | ||||
|  | ||||
| namespace GerstITS.Examples.Api.Swagger | ||||
| { | ||||
|     internal class WebApiConfiguration : ISwaggerConfiguration, IConfiguration | ||||
|     { | ||||
|         #region Constructors | ||||
|  | ||||
|         public WebApiConfiguration() | ||||
|         { | ||||
|             var currentAssembly = typeof(WebApiConfiguration).Assembly; | ||||
|             var fileVersionInfo = FileVersionInfo.GetVersionInfo(currentAssembly.Location); | ||||
|              | ||||
|             Company = fileVersionInfo.CompanyName; | ||||
|             Name = fileVersionInfo.ProductName; | ||||
|             Release = currentAssembly.GetName().Version; | ||||
|  | ||||
|             TermsOfService = new Uri("https://en.wikipedia.org/wiki/Terms_of_service"); | ||||
|             License = new LicenseConfiguration | ||||
|             { | ||||
|                 Name = "MIT", | ||||
|                 Url = new Uri("https://opensource.org/licenses/MIT") | ||||
|             }; | ||||
|             SupportEMail = "info@examples.net"; | ||||
|  | ||||
|             Security = new SwaggerSecurityConfiguration | ||||
|             { | ||||
|                 AllowAnonymous = true | ||||
|             }; | ||||
|         } | ||||
|  | ||||
|         #endregion | ||||
|          | ||||
|         #region ISwaggerConfiguration | ||||
|  | ||||
|         public string Name { get; } | ||||
|         public string Company { get; } | ||||
|         public string SupportEMail { get; } | ||||
|         public Uri TermsOfService { get; } | ||||
|         public ILicense License { get; } | ||||
|         public Version Release { get; } | ||||
|         public IOpenApiSecuritySchemeConfiguration Security { get; } | ||||
|  | ||||
|         #endregion | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user