Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Swashbuckle.AspNetCore.Swagger;
- using Swashbuckle.AspNetCore.SwaggerGen;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace XP.Rede.FixedIncome.Api.Filters
- {
- public class AddRequiredHeaderParameter : IOperationFilter
- {
- public void Apply(Operation operation, OperationFilterContext context)
- {
- if (operation.Parameters == null)
- operation.Parameters = new List<IParameter>();
- operation.Parameters.Add(new HeaderParameter()
- {
- Name = "User-Token",
- In = "header",
- Type = "string",
- Required = false
- });
- }
- class HeaderParameter : NonBodyParameter
- {
- }
- }
- }
Add Comment
Please, Sign In to add comment