Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidFormatException parsing GHEventPayload.PullRequestReview #421

Closed
ggrell opened this issue Mar 2, 2018 · 0 comments
Closed

InvalidFormatException parsing GHEventPayload.PullRequestReview #421

ggrell opened this issue Mar 2, 2018 · 0 comments

Comments

@ggrell
Copy link
Contributor

ggrell commented Mar 2, 2018

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",
...
@kohsuke kohsuke closed this as completed in 9cc400a May 1, 2018
kohsuke added a commit that referenced this issue May 1, 2018
Fixes #421 - Enum case doesn't match for Pull Request Reviews
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant