-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApiVersioning and DefaultApiVersion / AssumeDefaultVersionWhenUnspecified weird side effects #2630
Comments
Maybe try GroupNames = new ["", "v1"] |
Or what could be the API Explorer group name for non-versioned operations? |
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: hidegh/Meal-tracker@04314e5 (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. |
Sure.
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: 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: hidegh/Meal-tracker@a228f04
Just on the MealsController I did define v1/v2/default routing.
NSwag screenshots:
The text was updated successfully, but these errors were encountered: