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

Routes dont appear in ApiExplorer (WebApi RC) #86

Closed
mckn opened this Issue Jun 19, 2012 · 21 comments

Comments

Projects
None yet
3 participants
@mckn

mckn commented Jun 19, 2012

I tried to use the ApiExplorer to generate a documentation for my API. But the routes that I have registered with AttributeRouting isn't detected by the ApiExplorer.

I don't know why but if I add the routing by using the routes.MapHttpRoute(...) method they all appear as they should.

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Jun 20, 2012

Owner

This might be related to #83

Owner

mccalltd commented Jun 20, 2012

This might be related to #83

@mckn

This comment has been minimized.

Show comment
Hide comment
@mckn

mckn Jun 21, 2012

I'm not sure. I think it could be because the ApiExplorer search for IHttpRoutes and, correct me if I'm wrong, AttributeRouting uses ordinary routes that don't implement that interface?

http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/de16aded54ab#src%2fSystem.Web.Http%2fDescription%2fApiExplorer.cs

mckn commented Jun 21, 2012

I'm not sure. I think it could be because the ApiExplorer search for IHttpRoutes and, correct me if I'm wrong, AttributeRouting uses ordinary routes that don't implement that interface?

http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/de16aded54ab#src%2fSystem.Web.Http%2fDescription%2fApiExplorer.cs

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Jul 9, 2012

Owner

I don't recall any IHttpRoute in the source. Will look into this further. Sorry for the delay, been away from the macine for a few weeks.

Owner

mccalltd commented Jul 9, 2012

I don't recall any IHttpRoute in the source. Will look into this further. Sorry for the delay, been away from the macine for a few weeks.

@mckn

This comment has been minimized.

Show comment
Hide comment
@mckn

mckn Jul 9, 2012

I think we need to use the same code in AttributeRouting.Web.Http as in AttributeRouting.Web.Http.SelfHost. It looks like you use the HttpRoute there and that class implements the IHttpRoute.

mckn commented Jul 9, 2012

I think we need to use the same code in AttributeRouting.Web.Http as in AttributeRouting.Web.Http.SelfHost. It looks like you use the HttpRoute there and that class implements the IHttpRoute.

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Aug 4, 2012

Owner

Yes, I think you are correct. Looking into the webstack source and it seems that AR should be building a System.Web.Http.WebHost.Routing.HostedHttpRoute. But this object is internal! So will have to go through the source and see what we can use, if this object is public in the nightly builds, etc....

Owner

mccalltd commented Aug 4, 2012

Yes, I think you are correct. Looking into the webstack source and it seems that AR should be building a System.Web.Http.WebHost.Routing.HostedHttpRoute. But this object is internal! So will have to go through the source and see what we can use, if this object is public in the nightly builds, etc....

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Aug 5, 2012

Owner

Give the code in master a try if you'd like. I believe this might have been resolved by 2.4.2.

Owner

mccalltd commented Aug 5, 2012

Give the code in master a try if you'd like. I believe this might have been resolved by 2.4.2.

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mckn

This comment has been minimized.

Show comment
Hide comment
@mckn

mckn Aug 6, 2012

I tried to do the same in a ApiController but I couldn't get the explorer to detect my routes.

Edit: Yes, I updated to the 2.4.2 version.

mckn commented Aug 6, 2012

I tried to do the same in a ApiController but I couldn't get the explorer to detect my routes.

Edit: Yes, I updated to the 2.4.2 version.

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Aug 6, 2012

Owner

Interesting. I'm still working to resolve the ApiExplorer integration, FYI.

Owner

mccalltd commented Aug 6, 2012

Interesting. I'm still working to resolve the ApiExplorer integration, FYI.

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Aug 6, 2012

Owner

Try 2.4.3. I just pushed to nuget. If it still isn't working for you, you can give me more details about what you are doing and I can try and help. I do have a demo of using ApiExplorer in AttributeRouting.Tests.Web, FYI.

Owner

mccalltd commented Aug 6, 2012

Try 2.4.3. I just pushed to nuget. If it still isn't working for you, you can give me more details about what you are doing and I can try and help. I do have a demo of using ApiExplorer in AttributeRouting.Tests.Web, FYI.

@mckn

This comment has been minimized.

Show comment
Hide comment
@mckn

mckn Aug 7, 2012

Now it's working! I updated to 2.4.3 version and it worked. Thanks alot, what did you change?

mckn commented Aug 7, 2012

Now it's working! I updated to 2.4.3 version and it worked. Thanks alot, what did you change?

@mckn mckn closed this Aug 7, 2012

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Aug 7, 2012

Owner

Just changed some underlying bits to tie into the RC version of Web API properly (ie: copied what MS did). But so glad it's working!

Owner

mccalltd commented Aug 7, 2012

Just changed some underlying bits to tie into the RC version of Web API properly (ie: copied what MS did). But so glad it's working!

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Aug 7, 2012

Owner

Also note that you're going to encounter the problems mentioned in #102. But I am working closely with the ASP.NET team to resolve all the remaining Web API goofiness so AR can be a default package in new web projects.

Owner

mccalltd commented Aug 7, 2012

Also note that you're going to encounter the problems mentioned in #102. But I am working closely with the ASP.NET team to resolve all the remaining Web API goofiness so AR can be a default package in new web projects.

@brentpabst

This comment has been minimized.

Show comment
Hide comment
@brentpabst

brentpabst Aug 31, 2012

Hi, running v2.5.3 and .NET 4.5 and I'm still not able to get the ApiExplorer to populate my routes. In all fairness I am not storing the actuall code files in the default controllers folder but I didn't think that would matter. Is there a specific set of instructions or things you have to do to get the ApiExplorer to load the AR routes?

brentpabst commented Aug 31, 2012

Hi, running v2.5.3 and .NET 4.5 and I'm still not able to get the ApiExplorer to populate my routes. In all fairness I am not storing the actuall code files in the default controllers folder but I didn't think that would matter. Is there a specific set of instructions or things you have to do to get the ApiExplorer to load the AR routes?

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Aug 31, 2012

Owner

I have a sample in AttributeRouting.Tests.Web. I haven't ver used the
ApiExplorer, so I don't have anything to offer off the top of my head. Just
ctrl-F to find the sample and compare to yours. Let me know what you find.

On Aug 31, 2012, at 7:15 AM, Brent Pabst notifications@github.com wrote:

Hi, running v2.5.3 and .NET 4.5 and I'm still not able to get the
ApiExplorer to populate my routes. In all fairness I am not storing the
actuall code files in the default controllers folder but I didn't think
that would matter. Is there a specific set of instructions or things you
have to do to get the ApiExplorer to load the AR routes?


Reply to this email directly or view it on
GitHubhttps://github.com/mccalltd/AttributeRouting/issues/86#issuecomment-8191553.

Owner

mccalltd commented Aug 31, 2012

I have a sample in AttributeRouting.Tests.Web. I haven't ver used the
ApiExplorer, so I don't have anything to offer off the top of my head. Just
ctrl-F to find the sample and compare to yours. Let me know what you find.

On Aug 31, 2012, at 7:15 AM, Brent Pabst notifications@github.com wrote:

Hi, running v2.5.3 and .NET 4.5 and I'm still not able to get the
ApiExplorer to populate my routes. In all fairness I am not storing the
actuall code files in the default controllers folder but I didn't think
that would matter. Is there a specific set of instructions or things you
have to do to get the ApiExplorer to load the AR routes?


Reply to this email directly or view it on
GitHubhttps://github.com/mccalltd/AttributeRouting/issues/86#issuecomment-8191553.

@brentpabst

This comment has been minimized.

Show comment
Hide comment
@brentpabst

brentpabst Aug 31, 2012

Yea, tried looking into that but even with copying your code in over mine still no joy. It may simply be an issue with the RTM bits versus RC. Either way, I've actually rethought how I want to generate help pages and actually determined I'd rather create a web service that provides a JSON feed of the entire set of services or per controller and then display that on a different application. Separates the API application/service from the marketing and CMS content.

brentpabst commented Aug 31, 2012

Yea, tried looking into that but even with copying your code in over mine still no joy. It may simply be an issue with the RTM bits versus RC. Either way, I've actually rethought how I want to generate help pages and actually determined I'd rather create a web service that provides a JSON feed of the entire set of services or per controller and then display that on a different application. Separates the API application/service from the marketing and CMS content.

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Aug 31, 2012

Owner

Cool. Thanks for poiting out the problem though. I'll still look into it
for the next guy. :)

On Aug 31, 2012, at 9:06 AM, Brent Pabst notifications@github.com wrote:

Yea, tried looking into that but even with copying your code in over mine
still no joy. It may simply be an issue with the RTM bits versus RC. Either
way, I've actually rethought how I want to generate help pages and actually
determined I'd rather create a web service that provides a JSON feed of the
entire set of services or per controller and then display that on a
different application. Separates the API application/service from the
marketing and CMS content.


Reply to this email directly or view it on
GitHubhttps://github.com/mccalltd/AttributeRouting/issues/86#issuecomment-8194908.

Owner

mccalltd commented Aug 31, 2012

Cool. Thanks for poiting out the problem though. I'll still look into it
for the next guy. :)

On Aug 31, 2012, at 9:06 AM, Brent Pabst notifications@github.com wrote:

Yea, tried looking into that but even with copying your code in over mine
still no joy. It may simply be an issue with the RTM bits versus RC. Either
way, I've actually rethought how I want to generate help pages and actually
determined I'd rather create a web service that provides a JSON feed of the
entire set of services or per controller and then display that on a
different application. Separates the API application/service from the
marketing and CMS content.


Reply to this email directly or view it on
GitHubhttps://github.com/mccalltd/AttributeRouting/issues/86#issuecomment-8194908.

@brentpabst

This comment has been minimized.

Show comment
Hide comment
@brentpabst

brentpabst Dec 7, 2012

Hi,

Just following up to see if this was ever investigated. I was able to create a brand new project and everything works as expected. However, my existing project does not but that could be for god knows what reason. I have a sample project for others but it doesn't look like I can attach it here.

brentpabst commented Dec 7, 2012

Hi,

Just following up to see if this was ever investigated. I was able to create a brand new project and everything works as expected. However, my existing project does not but that could be for god knows what reason. I have a sample project for others but it doesn't look like I can attach it here.

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Dec 8, 2012

Owner

No. It fell of the table. Reading over the discussion, and knowing that AR and ApiExplorer have some other issues anyway, I'd like a sample project recreating the issue (could just pop it into a github repo for me to clone). It seems really inconsistent and I have frankly no idea what could be happening at this point or why the ApiExplorer is misbehaving.

Owner

mccalltd commented Dec 8, 2012

No. It fell of the table. Reading over the discussion, and knowing that AR and ApiExplorer have some other issues anyway, I'd like a sample project recreating the issue (could just pop it into a github repo for me to clone). It seems really inconsistent and I have frankly no idea what could be happening at this point or why the ApiExplorer is misbehaving.

@brentpabst

This comment has been minimized.

Show comment
Hide comment
@brentpabst

brentpabst Dec 8, 2012

Yep, agreed. I can't seem to understand what the difference is either. I have a feeling it has to do with how/when the routes are added to the Routing Table thing.

I'm going to try setting up my base project and add things to match what is currently in place and see when the behavior goes nuts.

If I can get it to do so I'll get a project uploaded for you to take a look at.

brentpabst commented Dec 8, 2012

Yep, agreed. I can't seem to understand what the difference is either. I have a feeling it has to do with how/when the routes are added to the Routing Table thing.

I'm going to try setting up my base project and add things to match what is currently in place and see when the behavior goes nuts.

If I can get it to do so I'll get a project uploaded for you to take a look at.

@mccalltd

This comment has been minimized.

Show comment
Hide comment
@mccalltd

mccalltd Dec 8, 2012

Owner

Cool, thanks!

Owner

mccalltd commented Dec 8, 2012

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment