I'm using a CMS. So when I go to i.e. '/painter' its routed to the 'JobController'. /plumber is also routed to 'JobController'. Besides that it's MVC and not WebAPI, so swagger doesn't discover it, which is understandable and fine.
But I've a usecase, where if I access /pianter?json=1 it returnes json instead of HTML.
So as an API UI we would like to expose this 'fake' endpoint, just so the designers can see the output model.
So can I add an entirely fake endpoint - just to have a single userinterface between the designers and developers in swagger UI?
Besides having a visual UI, we want to generate some TypeScript based on the openapi standard.
Here is an option to create Fake endpoint with swashbuckle using
IDocumentFilter
:Here is the result of something like that: http://swashbuckletest.azurewebsites.net/swagger/ui/index#/Fake
The full code behind that is on github: https://github.com/heldersepu/SwashbuckleTest/blob/master/Swagger_Test/App_Start/SwaggerConfig.cs#L316