c# – Swagger not showing v2 data in UI with no way of changing


I’m implementing some versioning in my Minimal API for .NET 8 and I’ve hit a bit of a snag.

My documentation won’t load the v2 API doc into Swagger when I run the application.

I have this Swagger setup:

enter image description here

and a bit further, I have my versioning set up to use URL versioning (that is policy currently here which is fine):

enter image description here

For the purposes of testing I have hardcoded the v2 into the URL on this extension but this creates the group (the individual mappings are then added afterwards for each file):

enter image description here

My issue here isn’t that it’s not adding it, if I navigate to v2/swagger.json at runtime I get the version file fine with the definition in it, but on /swagger only the v1 is loaded and there is no way to switch to the v2 to view the created endpoints:

enter image description here

There’s no v2 there, either in the dropdown at the top or listed on the left.

What am I missing?

Leave a Reply

Your email address will not be published. Required fields are marked *