Closed douglaslps closed 10 years ago
As this is a breaking change, I prefer to postpone this for vNext.
Your eror has been fixed in vnext branch. Please check out the changes and see if you're happy with it. I have not yet finalized the documentation nor pushed a prerelease package, but based on this file you should be able to get it working.
You can now choose a prefix for versioning in the URL by specifying in the route configuration. For example: api/v{version}/{controller}
.
Fantastic! Thanks.
I have updated the README :)
Beta 1 of vNext is available: https://www.nuget.org/packages/SDammann.WebApi.Versioning/3.0.0-beta1
This is my route configuration:
config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{version}/{controller}/{id}", defaults: new { id = RouteParameter.Optional } );
I don't want to use "api/v1/". I like "api/1/" better. I was testing it and if I try to access "api/x/" an exception is thrown:
Do you think you can fix it? IMHO returning an error saying the version wasn't find would be better.