timols / java-gitlab-api

A wrapper for the Gitlab API written in Java
Apache License 2.0
387 stars 317 forks source link

Using wrong names for parameters (mergeRequestIid named mergeRequestId) #299

Closed tomasbjerre closed 6 years ago

tomasbjerre commented 6 years ago

Problem

The GitLabAPI uses name mergeRequestId where it should be using name mergeRequestIid.

https://github.com/timols/java-gitlab-api/blob/master/src/main/java/org/gitlab/api/GitlabAPI.java#L1482

    public GitlabMergeRequest getMergeRequestChanges(Serializable projectId, Integer mergeRequestId) throws IOException {
        String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabMergeRequest.URL + "/" + mergeRequestId + "/changes";
        return retrieve().to(tailUrl, GitlabMergeRequest.class);
    }

Here is the docs: https://docs.gitlab.com/ee/api/merge_requests.html#get-single-mr-changes

Proposed solution

This single case could, of course, be changed quickly with a PR. But it would break the API. If the next version will break the API, then maby it is good to go through all the calls and try to find more faulty names. Instead of breaking the API repeatedly in a series of versions. But this is just me assuming there are more faulty names to fix =)