octokit/webhooks.net

[BUG]: InvalidCastException during String to StringEnum Conversion in WorkflowJobStatus Deserialization

Monica-Zhang-git opened this issue ยท 3 comments

What happened?

What happened?

After upgrading Octokit.Webhooks.AspNetCore from 1.5.1 to 2.2.2 we noticed the test failed. we encountered an InvalidCastException while attempting to deserialize webhook payloads into the WorkflowJobStatus enum using the SimpleJsonSerializer in the Octokit.Webhooks library.

The error message is as following:

System.InvalidCastException : Invalid cast from 'System.String' to 'Octokit.Webhooks.Extensions.StringEnum1[[Octokit.Webhooks.Models.WorkflowJobEvent.WorkflowJobStatus, Octokit.Webhooks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxx]]'.`

Could you please provide guidance or a potential fix for this issue? Any help from the Octokit team would be greatly appreciated.

Versions

Octokit.Webhooks.AspNetCore v2.2.2

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

๐Ÿ‘‹ Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! ๐Ÿš€

@Monica-Zhang-git are you able to provide a sample payload or some sample code to help reproduce the issue?

@JamieMagee, Thanks for following up on this issue. We have solved it. Cheers