azure-devops-java-sdk
azure-devops-java-sdk copied to clipboard
GitChange.changeType: InvalidArgumentValueException: The body of the request contains invalid Json.
Hi,
Since version 6.1.3 and PR #92, the git push returns an error:
org.azd.exceptions.AzDException: InvalidArgumentValueException: The body of the request contains invalid Json.
Parameter name: contentStream
at org.azd.abstractions.serializer.JsonSerializer.deserialize(JsonSerializer.java:70)
at org.azd.abstractions.internals.ClientRequestAdapter.execute(ClientRequestAdapter.java:136)
at org.azd.git.pushes.PushesRequestBuilder.create(PushesRequestBuilder.java:121)
The PR #92 adds a JsonDeserializer for changeType in GitChange. But not a JsonSerializer, so, in the json, changeType is a list instead of a string and the Azure DevOps API throws the error.
e.g.
{
"commits": [
{
"author": {
"email": "[redacted]",
"name": "[redacted]"
},
"changes": [
{
"changeType": [ <-- List of string instead of a string
"edit"
],
"item": {
"isFolder": false,
"isSymLink": false,
"path": "[redacted]"
},
"newContent": {
"content": "[redacted]",
"contentType": "base64Encoded"
}
},
...
"comment": "[redacted]",
"commentTruncated": false
}
]
}
@c4rth, Thanks for reporting. Let me take a look.