I am putting together swagger documentation for a C# API (with NSWAG) It's written using ASP.NET Framework, not Core... I don't think I can take advantage of some of the newest features of Swagger / Open API
We have a baseapicontroller than inherits apicontroller
I don't want the baseapicontroller itself to appear in swagger
But I do want some of its child controllers to appear
If I use the following, it hides the base and the children
#if DEBUG
[ApiExplorerSettings(IgnoreApi = false)]
#else
[ApiExplorerSettings(IgnoreApi = true)]
#endif
What is the solution?
I've read about [AttributeUsage (Inherited = True)] but I think that will affect all attributes... that's not what I want
Actually I thought of two things that make me realise this is a stupid question:
I can apply the instruction to ignore the APIExplorerSettings at the level of an individual endpoint so this is moot
Also, everything in the baseApi is protected anyway so Swagger won't show it...
Please accept your own answer (when you are able to) to close this question.