icyleaf/gitlab.cr

Halite error on deletion caused by 204 "No Content"

Closed this issue · 6 comments

When deleting a user a halite error is raised...

Unhandled exception: Missing media type (Halite::Exception::Error)
  from lib/halite/src/halite/response.cr:84:9 in 'parse'

The GitLab API documentation says it User deletion returns with 204 No Content on success. I made a bypass by changing the response type to Halite::Response and removing parse() but this does not feel right.

What should be a proper way to handle 204 reponses? Add an exception for 204's in de parse() method?

I'm happy to apply a solution as PR and search the code for more cases like this.

Gitlab all API DELETE endpoints return 204 and respect the If-Unmodified-Since header in GitLab 9.0. sadly https://gitlab.com/gitlab-org/gitlab-foss/-/issues/20429

Sorry for not understanding what's sad... Is there an open issue with GitLab? Shouldn't gitlab.cr have a workaround solution until this problem is fixed?

I open a PR but there are too many APIs that need to be changed and I may not have the energy to ensure that it's done quickly currently.

If you you show me the way you like it, I'm happy to help. The code is quiet homogeneous. I'm working on a project that needs real life integration tests so I might be able to generate integration tests for gitlab.cr

Thank you for helping, i commited a change from #34 which you should see the code.

Looks clear. You will receive PR's soon.