OData / ODataSamples

Samples: For ODataLib, OData Web API, RESTier, etc.
http://odata.github.io/
Other
293 stars 222 forks source link

GetServiceRootUri in the RESTier version of Trippin fails if route prefix is empty #129

Open nonbob opened 4 years ago

nonbob commented 4 years ago

I pulled down ODataSamples today and built the RESTier version of the Trippin service. It built out of the box (using VS 2017 on Windows 10 1909), but when I tried to use one of the GET . . ./$ref routes, it blew up in GetServiceRootUri, which doesn't like having an empty route prefix. I patched around it locally. I could offer my workaround as a PR but. . .first I'll have to go dig into the PR history and see what the local standards are.

BTW, I'm very grateful for the GET . . ./$ref examples. Examples of GET . . ./$ref are a bit hard to find - filtering the results one gets when searching for "$ref" on the innertubes (or even on GitHub) can be a bit daunting (I'd be glad for any advice on that)

nonbob commented 4 years ago

Upon further investigation, I see that the code in https://github.com/OData/ODataSamples/blob/master/RESTier/Trippin/Trippin/Helpers.cs correctly derives the service root. Perhaps GetServiceRootUri should be using similar code/sharing code?