oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Client code not generated

Open asadabbasfolio3 opened this issue 2 years ago • 4 comments

I am following the readme instructions , and able to generate server code but it does not generate Client code. what I am missing?

asadabbasfolio3 avatar Jun 26 '22 11:06 asadabbasfolio3

If you're able to share your config file you're using that may be helpful.

For instance, this is what I've got:

package: api
generate:
  models: true
  client: true
output: client.gen.go

jamietanna avatar Jun 28 '22 15:06 jamietanna

I just tested this with and without a config (on v1.11.0). Without a config (eg. -generate types,server,client,spec) the command fails to generate client code. Using a config results in client code being generated.

Also, the example config provided in this section of the README needs to be updated. The "generate" section cannot be a list or else the command fails.

And it sounds like the two issues might be related?

bctsui avatar Aug 30 '22 22:08 bctsui

README needs to be updated, although I am able to get generate my client by providing these parameters.

go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest
	oapi-codegen -old-config-style --package=gen --generate=types,client -o ./gen/openapi.gen.go ./openapi.yml``

asadabbasfolio3 avatar Aug 31 '22 07:08 asadabbasfolio3

Somehow it only prints the code to stdout and does not save it to the provided output file...

bykof avatar Sep 15 '22 13:09 bykof