octokit / webhooks.net

GitHub webhook events toolset for .NET
MIT License
48 stars 30 forks source link

[BUG]: New custom property polymorphic values break deserialization #520

Closed colbylwilliams closed 1 week ago

colbylwilliams commented 2 weeks ago

What happened?

Custom Property and Custom Property Value schemas added new value_types and updated the default_value and value properties to allow for null, string, or array. This breaks deserialization of payloads with Custom Property or Custom Property Values.

More importantly, it breaks deserialization for any webhook payload that has a Repository property, and that Repository includes a custom property value that is an array.

Example workflow_job.completed that failed to deserialize by the webhook processor

{
  "action": "completed",
  "workflow_job": {
    "id": ...
  },
  "repository": {
    "id": ...
    "default_branch": "main",
    "custom_properties": {
      "dev_platform": "workflows",
      "test_ms": [
        "option_d",
        "option_e"
      ],
      "test_ss": "option_c",
      "test_tf": "foo"
    }
  },
  "organization": {
    "login": ...
}

Could not process GitHub event. The JSON value could not be converted to System.String. Path: $.repository.custom_properties.test_ms

Versions

Octokit.Webhooks v2.2.1

Relevant log output

No response

Code of Conduct

github-actions[bot] commented 2 weeks ago

👋 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! 🚀