Skip to content

Deserialization failing for field changeSet in BuildWithDetails #321

@holgpar

Description

@holgpar

Greetings,

I noticed that the the field changeSet in class BuildWithDetails is always null, even if present in the json data of the build. One reason seem to be that the actual json key is named 'changeSets' (with plural 's' at the end):

...
 "changeSets" : [
    {
      "_class" : "hudson.plugins.git.GitChangeSetList",
      "items" : [
        {
          "_class" : "hudson.plugins.git.GitChangeSet",
          "affectedPaths" : [
            "README.md"
          ],
          "commitId" : "ba40ff32c60f692918c1d51f5c80842124ed04af",
          "timestamp" : 1519306808000,
          "author" : {
            "absoluteUrl" : "https://myjenkins/user/holger.partsch",
            "fullName" : "holger.partsch"
          },
          "authorEmail" : "holger.partsch@sap.com",
          "comment" : "longer\ncommit message\n",
          "date" : "2018-02-22 13:40:08 +0000",
          "id" : "ba40ff32c60f692918c1d51f5c80842124ed04af",
          "msg" : "longer",
          "paths" : [
            {
              "editType" : "edit",
              "file" : "README.md"
            }
          ]
        }
      ],
      "kind" : "git"
    }
  ],
...

Another problem is that changeSets is actually a json array. In later version of jackson, there is a way to deal with that, using the feature DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS.

I can do a pull request, but I would prefer to upgrade to latest jackson, if there is no reason against hat.

Many thanks, Holger

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions