Moved projects to their own separate subdirectories
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user