finished implementing characters endpoints
This commit is contained in:
1 parent
9bc24949b7
commit
15eea06073
7 files changed
+157
-89
No files matched your search
@@ -0,0 +1,20 @@
|
||||
using Microsoft.OpenApi.Any;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
|
||||
namespace server.SwaggerOptions.Filters
|
||||
{
|
||||
public class ApiVersionOperationFilter : IOperationFilter
|
||||
{
|
||||
public void Apply(OpenApiOperation operation, OperationFilterContext context)
|
||||
{
|
||||
var headerParameter = operation.Parameters.Where(p => p.Name == "x-api-version").SingleOrDefault();
|
||||
|
||||
if (headerParameter != null)
|
||||
{
|
||||
headerParameter.Description = "Header value that identifies target version of api.";
|
||||
headerParameter.Schema.Default = new OpenApiString(context.DocumentName.ToLower().Replace("v", ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user