aspnet / AspNetWebHooks

Libraries to create and consume web hooks on ASP.NET 4.x (Due to other priorities this project is currently in maintenance mode only. There are no planned releases at this time. No new features are planned and we are only addressing critical issues as required.)
Apache License 2.0
134 stars 103 forks source link

ASP.NET Web Api with enabled versioning + WebHooks #32

Closed JakubHolovsky closed 5 years ago

JakubHolovsky commented 5 years ago

I would like to use for our project the Microsoft.AspNet.WebHooks.Receivers.Stripe library. However my WebApi is ApiVersion (Microsoft.AspNet.WebApi.Versioning) enabled. That somehow interferes with the WebHooks default Url which is:

https://<host>/api/webhooks/incoming/<receiver>

I am using the sample StripeWebHookHandler from the AspNet samples. I tried putting the ApiVersion on the WebHookHandler like this with no success:

[ApiVersion("1")]
[RoutePrefix("api/v{version:apiVersion}/webhooks/incoming/stripe")]
public class StripeWebHookHandler : WebHookHandler

I am guessing that this must be a common problem however I haven't found any solution to this, is there anyway:

1) to have the webhook URL versioned using the provided StripeWebHookHandler.

2) to disable the versioning for this particular URL (also tried the [ApiVersionNeutral] attribute).

dougbu commented 5 years ago

Hi. It looks like this is a question about how to use ASP.NET WebHooks. While we do our best to look through all the issues filed here, to get a faster response we suggest posting your questions to StackOverflow using the 'asp.net-webhooks' tag.

Please let us know here if you find an answer.

dougbu commented 5 years ago

@JakubHolovsky have you resolved your issue? If so, please close this one. If not, please provide more detail.

JakubHolovsky commented 5 years ago

@dougbu I resolved the issue by not using your library