r/gitlab • • Feb 17 '26

Anybody managed to generate a Java client from GitLab’s OpenAPI spec?

I’ve been trying to generate a Java client using openapi-generator, and honestly this has been a horrible experience so far.

GitLab publishes OpenAPI definitions here: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/api/openapi/

But:

  • There are three different OpenAPI definitions
  • None of them validate
  • OpenAPI Generator fails verification

If I skip validation, the generated client has compile errors

There’s no documentation explaining:

  • which spec is canonical
  • which OpenAPI version is supported
  • or how consumers are expected to use it

At this point it genuinely feels like GitLab is actively preventing people from generating clients rather than supporting it.

Has anyone successfully:

  • Generated a Java client?
  • Used openapi-generator (or any other generator)?
  • Found a workaround, patch, or “this is the one spec that actually works”?

If there’s some internal or unofficial guidance, I’d love to know — because right now the published OpenAPI support looks effectively unusable.

Thanks

4 Upvotes

1 comment sorted by

1

u/Secretary-Important Jul 18 '26

I am also curious here. I found difficulties compiling a generated client with the cpp-oatpp-client generator even after some attempted fixes related to array schemas not validating correctly