-
Notifications
You must be signed in to change notification settings - Fork 41
Description
What happened?
When deserializing a projects_v2_item
event into a ProjectsV2ItemEvent
, deserialization works fine when you use a single select field and the changes
part of the payload looks like this:
"changes": {
"field_value": {
"field_node_id": "PVTF_lADOAWcTxs07G84AAali",
"field_type": "single_select",
"field_name": "Status",
"project_number": 18,
"from": {
"id": "f75ad846",
"name": "Todo",
"color": "GREEN",
"description": "This item hasn't been started"
},
"to": {
"id": "47fc9ee4",
"name": "In Progress",
"color": "YELLOW",
"description": "This is actively being worked on"
}
}
},
However, according to the docs, the from
and to
fields can be one of :null, string, integer, or object. (And from my testing, a numeric can also be contain a decimal as well.)
Because the code currently expects those fields to always be an object of type ChangesFieldValueChange
, the scalar use cases like this one:
"changes": {
"field_value": {
"field_node_id": "PVTF_lADOAEzhac4AjFojzgbzsKM",
"field_type": "date",
"field_name": "Start Date",
"project_number": 233,
"from": null,
"to": "2025-08-01T00:00:00+00:00"
}
},
...result in a deserialization error:
Result: Exception processing GitHub event.
Exception: System.Text.Json.JsonException: The JSON value could not be converted to Octokit.Webhooks.Models.ProjectsV2ItemEvent.ChangesFieldValueChange. Path: $.changes.field_value.to | LineNumber: 0 | BytePositionInLine: 1392.
Versions
Octokit.Webhooks 3.0.0
Relevant log output
Included in description above.
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Type
Projects
Status