Open hidegh opened 4 years ago
Maybe try
GroupNames = new ["", "v1"]
Or what could be the API Explorer group name for non-versioned operations?
@RicoSuter
The GroupNames = [""] will return NO result (was trying it). I do have an auto group definition add, but yes, it can be patched... the apiVersionDescriptionProvider.ApiVersionDescriptions do return V1 and V2 only...
I'm experimenting, especially focusing on flexibility as versioning is required with old apps and upgrades, so the existing architecture, solution, URI's are given, the setup is the one should allow the necessary flexibility.
Now it seems that the default (non versioned route) and versioned route works a bit odd, like. I was able to avoid getting the non versioned route to both versions (a logical way that was given, not sure if that flexibility in the long run will be OK for a real project). What is weird is to have the non versioned routes inside the V1 definition which actually doubles each endpoint. It would be interesting to have the "actual" non versioned routes separatelyt from v1/v2 as well...
Issue (not necessarily a bug):
Last commit with v1/v2 separation: https://github.com/hidegh/Meal-tracker/commit/04314e5cf7a8a1ac38e1b0e4158725148bdabe90 (as I told, it's an experiment, so I DUPED the MealController to have a separate V2)...
In the end you need to figure out how to configure the ASP.NET Core API Explorer so that it reports the correct operations. NSwag only picks up the specified GroupNames and generates them... it's not something which can be "fixed" or changed in NSwag.
Thank you. If you don't mind, plz. keep this open, when I will have news, will post it there (meanwhile others can also use my repo to experiment with). Btw. quickest "support" here, you even beat the author of Mime/MailKit.NET who released a quick fix whithin 24h while on vacation :D I really like NSwag, although some configs (documentation) are for the old versions (so getting started is not the easiest)... Ev. label this as "not-bug", something that relates to ApiExplorer and documentation.
keep this open, when I will have news, will post it there
Sure.
although some configs (documentation) are for the old versions (so getting started is not the easiest)...
Yeah i know the public config/API surface is huge - mainly because I didnt deprecate old stuff yet (e.g. Web API support).
Related PR which might contain more info: https://github.com/RicoSuter/NSwag/pull/1701
Also please update the wiki if something is missing.
And maybe @commonsensesoftware can help here?
I was adding API versioning to my project, listing concrete versions was fine. Issue is when I do define a default route without any version segment.
Question is how to set up the NSwag so that it:
For sample see this project & commit: https://github.com/hidegh/Meal-tracker/commit/a228f04713554c0af48e3033a568d80bccf6901f
Just on the MealsController I did define v1/v2/default routing.
NSwag screenshots: