I want to integrate Swagger UI into my C# .Net Web API project. This is different from a traditional Web API project where you can install a tool like SwashBuckle, which then picks up the HTTP routes defined in your controller classes and creates the UI.
What I have is a custom implementation which generates the OpenAPI/Swagger 3.0 yaml files for different routes.
I have a route defined in a generic controller file which accepts a variable -
http://localhost:8000/myapp/swagger/{document_name}
where document_name is a variable. My code takes this variable and generates the custom documentation based on this value.
http://localhost:8000/myapp/swagger/sedan
http://localhost:8000/myapp/swagger/suv
In the example above my code would return a different Open API spec for sedan and suv.
As of now the URL simply returns Open API 3.0 YAML spec in plain text. What I want to be able to do is to be able to have this file represented in the Swagger UI similar to this -
http://petstore.swagger.io/
Is this possible? Can I use Swashbuckle for this? Do I need to do a custom implementation to host the Swagger UI? What's the best way?