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

Unable to remove all/last topics from project

Open Jenson3210 opened this issue 1 year ago • 2 comments

This line makes it impossible to remove the last topic from a project.

Imo, if i do not want to make changes to that property, i should provide null, not empty list.

As this would be a breaking change (perhaps people today are relying on empty list making no changes), I did not start a PR.

Jenson3210 avatar Mar 07 '24 15:03 Jenson3210

You mean:

https://github.com/gitlab4j/gitlab4j-api/blob/6c06521abedebedad64a47b48960f570fba48dd7/src/main/java/org/gitlab4j/api/ProjectApi.java#L1344-L1346

&& !project.getTopics().isEmpty() should be removed?

Then the semantic would be:

  • null: no change
  • empty list: remove the topics.

Maybe I didn't get you right.

jmini avatar Mar 08 '24 16:03 jmini

That's indeed what I meant. At this moment I cannot remove the last topic as this would then not send topics argument.

Wrote my own ProjectsApi extending this one and overwrote that method only and removal worked by sending empty list.

Jenson3210 avatar Mar 08 '24 16:03 Jenson3210