Initial commit

This commit is contained in:
Carl Tibule
2023-01-25 00:06:14 -06:00
commit e0b38beff6
37 changed files with 1593 additions and 0 deletions

View File

@ -0,0 +1,10 @@
namespace YABA.API.Settings
{
public class Auth0Settings
{
public string Domain { get; set; }
public string ClientSecret { get; set; }
public string ClientId { get; set; }
public string Identifier { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace YABA.API.Settings.Swashbuckle
{
public class RemoveVersionParameterFilter : IOperationFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
var versionParameter = operation.Parameters.Single(p => p.Name == "version");
operation.Parameters.Remove(versionParameter);
}
}
}

View File

@ -0,0 +1,18 @@
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace YABA.API.Settings.Swashbuckle
{
public class ReplaceVersionWithExactValueInPathFilter : IDocumentFilter
{
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
var paths = new OpenApiPaths();
foreach (var path in swaggerDoc.Paths)
{
paths.Add(path.Key.Replace("v{version}", swaggerDoc.Info.Version), path.Value);
}
swaggerDoc.Paths = paths;
}
}
}