I have a requirement to add a common header in swagger. I have tried IOperationFilter but it is asking every API call. I need to add a header like a bearer token.
Asked
Active
Viewed 174 times
0
-
_"I have tried IOperationFilter but it is asking every API call."_ What do you mean "but is asking every API call"? – Andy May 25 '21 at 14:40
-
@Ashok take a look for this answer https://stackoverflow.com/a/41493260/3520507. You can add non-required header `Required = false` in swagger with `IOperationFilter`. Also there are a lot of other ways to do this, describes in the answers – DarkSideMoon May 27 '21 at 09:54