My current setup is that I am using swagger/swashbuckler in an ASP.NET Core 3.1 Web API. I have multiple version set up using the tags ApiVersion and MapToApiVersion to separate into the appropriate API versions. Then I use a DocInculsionPredicate to separate into the correct documentation version. This is working fine.
I wish to know how I can insert the contents of a static html file beneath the "description" in the information-container div of the Swagger generated documentation.
I've the need for this content to be dependent on the version of the API that is chosen as the information is version specific.
Can anyone help?
According to your description, I suggest you could swagger editor to modify the page.
If you don't want to do it, one possible way is using js to modify the generated html page.
You could create a new js file inside the wwwroot's js folder with below codes:
Then modify the startup.cs codes to inject the js.
Result: