xanzy/go-gitlab

false values for EditProject don't get submitted

clofresh opened this issue · 2 comments

Looks like when submitting boolean parameters, only the true parameters get sent, and the false ones get skipped.

p := &gitlab.EditProjectOptions{
    IssuesEnabled:        false,
    MergeRequestsEnabled: false,
    WikiEnabled:          true,
    SnippetsEnabled:      false,
    VisibilityLevel:      gitlab.InternalVisibility,
}
gl.Projects.EditProject(*project.ID, p)

I added some logging to the marshalling step:

&gitlab.EditProjectOptions{Name:"", Path:"", Description:"", DefaultBranch:"", IssuesEnabled:false, MergeRequestsEnabled:false, WikiEnabled:true, SnippetsEnabled:false, Public:false, VisibilityLevel:10}
"{\"wiki_enabled\":true,\"visibility_level\":10}"

I think it's hitting this issue: golang/go#13284

Thanks for the report @clofresh! My time to work on this package is limited at this moment, but I'll make sure I'll have a look at it...

As always a PR with a possible fix would be more then welcome 😉

EDIT: This seems to be somewhat related to issue #29, yet they can be fixed separately

Fixed by PR #66