Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: Odata route versioning and service document [1367]

$
0
0
Following the general principle of route based versioning outlined here: http://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/ODataVersioningSample/ReadMe.txt

I have the following in my v1 namespace:
var model = modelBuilder.GetEdmModel();
config.Routes.MapODataRoute(
routeName: "OData",
routePrefix: null,
model: model);

config.Routes.MapODataRoute(
routeName: "Version1",
routePrefix: "v1",
model: model);
config.EnableQuerySupport();

I have the following in my v2 namespace:
var model = modelBuilder.GetEdmModel();

config.Routes.MapODataRoute(
routeName: "Version2",
routePrefix: "v2",
model: model);

config.EnableQuerySupport();

Now:
GET "/" == service document
GET "/v1/" == 404, and I expect the service document.
GET "/v2/" == 404, and I expect the service document.
GET "/v1/$metadata"== correct metadata.
GET "/v2/$metadata" == correct metadata.

I can't quite work out what else I'd need to do to get the service document to appear. It's not that important, it's just a quick way of verifying the the service is installed correctly.
Comments: Hi, apologies for the delay in getting back to you. I'm confident I'm declaring the routes in that order - everything works fine except the service document is unavailable under any prefix (but works with the prefix-less route) regarding the last route - I want to provide a prefix-less route that provides the V1 behaviour.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>