Help using OpenAPITools generated client (swagger)

Hello all,

I’m trying out Go for a REST client use case using a OpenAPITools generated client. That hasn’t gone to well so far.

OpenAPI Tools (github.com)

I’m trying to figure out if my errors below are because I did something wrong when I imported the generated client or if it’s because of any of the 3544 open issues in the openapi-generator project on github?

  1. I generated the client using the latest available .jar.
  2. Copied the output folder to the root of my go workfolder. (workfolder/go-client)
  3. Added a replace line in the go.mod of my main module pointing the go-client module to the go-client folder (workfolder/main-module)
  4. Typed go get go-client in the main module folder so it got added as a dependency in require in the go.mod file (I’m still a bit confused how to add dependencies)

That made intellisense (VSCode) find everything in the go-client folder so I was pretty happy. :smiley:

In the main function of my main-module I try to call an endpoint with the generated api-client. Unfortunately I get a few Build errors in the form of a handful of “undefined: Object” and a three “undefined: os” in the generated go-client module.

Where did I go wrong? Or is it the client generator that’s broken?

Any input is appreciated.

br,

molotch

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.