gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

org.gitlab4j.api.CommitsApi#getCommits(java.lang.Object) response object Author is always null

Open bububear opened this issue 1 year ago • 2 comments

When I call this interface /api/v4/projects/132/repository/commits?private_token=<personal_access_token> , I find that the Author is always null in the return parameter

Gitlab version : GitLab Community Edition [14.2.6]

bububear avatar Jan 21 '25 07:01 bububear

According to the specification: https://docs.gitlab.com/ee/api/commits.html#list-repository-commits

The commit JSON contains:

    "author_name": "randx",
    "author_email": "[email protected]",

And not a single author attribute.

This should be removed: https://github.com/gitlab4j/gitlab4j-api/blob/8259f86f881ec7408aabf569c567c23494f1b03d/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Commit.java#L12

jmini avatar Jan 22 '25 18:01 jmini

The problem is that the Author attribute in Commit is used in the push event:

https://github.com/gitlab4j/gitlab4j-api/blob/8259f86f881ec7408aabf569c567c23494f1b03d/gitlab4j-models/src/test/resources/org/gitlab4j/models/event.json#L36-L39

jmini avatar Jan 23 '25 06:01 jmini