Closed WestDiscGolf closed 6 years ago
Thinking maybe a general metadata class for the attribute to work from, or maybe a way to override the type it associated with.
Maybe an api like ...
[GeneralWebHook(Type = typeof(GitHubMetadata))]
... where you can override which type of meta data to use for the general web hook.
I've tried a hack of creating a GeneralMetadata class and registering it but didn't work. I'm obviously missing something :-(
Thank you for your feedback. We're closing this issue as it is fixed in our working code base. More recent builds are available from https://dotnet.myget.org/gallery/aspnetcore-dev
This was a known temporary situation in 1e89a0fb21:
temporarily breaks GitHub scenarios; real
IWebHookBodyTypeMetadataService
requirement coming in #254
Fixed in 730adf3128 (merged two days later).
I am experiencing the issue running the latest in the dev branch which has the referenced commit (https://github.com/aspnet/WebHooks/commit/730adf3128b60425157b53e248e1cea19dd74ad0) in it?
I've reset my local repository copy to make sure I have the latest ... ... and I am still getting the same error for the GeneralWebHookAttribute on the GithubController?
I am running the main dev branch from this repository.
Thanks for reporting this issue.
Ah, I see. Simple bug in WebHookModelBindingProvider
's check for the typeof(IWebHookBodyTypeMetadata)
property. The property won't exist unless the user has chosen a BodyType
when adding a [GeneralWebHook]
attribute.
I've confirmed this by updating the controller action to be ...
[GeneralWebHook(bodyType:WebHookBodyType.Json)]
public IActionResult FallbackHandler(string receiverName, string id, string eventName)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
return Ok();
}
And it starts up ok. Not tested the controller action though.
349a1ea864
Merged to dev
in 607d59b9e6
After getting latest changes and re-running the Github sample, on start up an error occurs in
WebHookModelBindingProvider
in theOnProviderExecuting
method.It errors when registering the
FallbackHandler
from the github controller ...The error occurs when it hits the following code ...
as there is no property for the
typeof(IWebHookBodyTypeMetadata)
for the GeneralWebHook.It feels like there needs to be a GeneralMetadata class, which derives from WebHookMetadata, is registered in
WebHookServiceCollectionSetup
.Thoughts?