Skip to content

InvalidFormatException parsing GHEventPayload.PullRequestReview #421

@ggrell

Description

@ggrell

I'm getting the following exception parsing a "pull_request_review" event on our GitHub Enterprise instance:

com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `org.kohsuke.github.GHPullRequestReviewState` from String "commented": value not one of declared Enum instance names: [CHANGES_REQUESTED, REQUEST_CHANGES, PENDING, DISMISSED, COMMENTED, APPROVED]
 at [Source: (StringReader); line: 28, column: 14] (through reference chain: org.kohsuke.github.GHEventPayload$PullRequestReview["review"]->org.kohsuke.github.GHPullRequestReview["state"])
com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `org.kohsuke.github.GHPullRequestReviewState` from String "commented": value not one of declared Enum instance names: [CHANGES_REQUESTED, REQUEST_CHANGES, PENDING, DISMISSED, COMMENTED, APPROVED]
 at [Source: (StringReader); line: 28, column: 14] (through reference chain: org.kohsuke.github.GHEventPayload$PullRequestReview["review"]->org.kohsuke.github.GHPullRequestReview["state"])
	at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1548) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:910) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.deser.std.EnumDeserializer._deserializeAltString(EnumDeserializer.java:255) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.deserialize(EnumDeserializer.java:179) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:136) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:136) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001) ~[jackson-databind-2.9.4.jar:2.9.4]
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3037) ~[jackson-databind-2.9.4.jar:2.9.4]
	at org.kohsuke.github.GitHub.parseEventPayload(GitHub.java:600) ~[github-api-1.92.jar:na]

where the beginning of the JSON payload looks like this:

{
  "action": "submitted",
  "review": {
    "id": 33666,
    "user": {
      "login": "REMOVED",
      "id": 193,
      "avatar_url": "REMOVED",
      "gravatar_id": "",
      "url": "REMOVED",
      "html_url": "REMOVED",
      "followers_url": "REMOVED",
      "following_url": "REMOVED",
      "gists_url": "REMOVED",
      "starred_url": "REMOVED",
      "subscriptions_url": "REMOVED",
      "organizations_url": "REMOVED",
      "repos_url": "REMOVED",
      "events_url": "REMOVED",
      "received_events_url": "REMOVED",
      "type": "User",
      "site_admin": false,
      "ldap_dn": "REMOVED"
    },
    "body": "Review test",
    "commit_id": "1348693c5fefd5dc58568b75ef69c81705bfb269",
    "submitted_at": "2018-03-01T23:41:54Z",
    "state": "commented",
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions