-
Notifications
You must be signed in to change notification settings - Fork 89
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
Support for versioning (#91) #93
base: master
Are you sure you want to change the base?
Conversation
… delegate to avoid triggering exception on property access
Conflicts: src/AttributeRouting/Extensions/HttpRequestBaseExtensions.cs
Initial support for versioning, as described on mccalltd#91
New AddVersions() method to make configuration of versioning (mccalltd#91) simpler.
Missed a spot implementing mccalltd#91
Hi Greg. Thanks for this. I'll be checking it out in the next few days. |
Conflicts: src/AttributeRouting.Web.Http/Framework/HttpAttributeRoute.cs src/AttributeRouting.Web.Http/HttpRouteAttribute.cs src/AttributeRouting.Web.Mvc/Framework/AttributeRoute.cs src/AttributeRouting/AttributeRouting.csproj src/AttributeRouting/ConfigurationBase.cs src/AttributeRouting/Framework/IAttributeRoute.cs src/AttributeRouting/Framework/RouteBuilder.cs src/AttributeRouting/Framework/RouteReflector.cs src/AttributeRouting/Framework/RouteSpecification.cs src/AttributeRouting/IRouteAttribute.cs
… names), and add example of different controller actions for different versions of the same URL
@mccalltd Now updated to current code as I'm starting to use this in another project. FWIW I have now been using the version in my original patch for about a year (and several releases) and have done several API changes with it, and this allows all the old versions to continue functioning with identical surface area. As a somewhat more concrete example of what we've been doing, let's say we have a model called UserPreferences
In 1.2, we switch to a key-value table, and the new UserPreferences model is now more like a dictionary What we do in this situation is copy the old Models.UserPreferences into Models.v1_1.UserPreferences, and add the MinVer to the controller action:
Then we make a new controller:
In this way, anyone calling the 1.0 or 1.1 APIs can continue to do so, and after this initial setup it's basically no extra work to maintain, yet we can still completely change the underlying storage model as well as fix bugs. We could also even add new properties to the old model (since that is a non-breaking change). |
What do your final url requests look like (for new and old version calls)? |
Works as described in issue #91.
Note for viewing the diff. 7b9396a and 48c9341 are my upstream merges, they do not have any actual effect.
I cannot figure out why git thinks RouteReflector is entirely changed, the actual diff is: