Forum Discussion
Hi prpuritan
Could you share the full command you're using? And if possible, could you try the same command with the petstore example, to see if that fails too.
output includes a go.mod file in the output directory.
Cheers,
Paul
PAUL ROSHAM // Systems Engineer | Pure Storage, Inc.
*Level 18, 567 Collins Street Melbourne, VIC 3000, Australia*
+61 411 198 989 <+61-411-198989> | prosham@purestorage.com
- prpuritan3 years agoNew Contributor
hi - not sure if you saw the attachment. I put the petstore API spec into petstore.json and used the following text in a Makefile. This depends on having Docker desktop (and Xcode on my MacBook) installed.
----------Makefile--------------
#
#
GOMOD_GENERATOR = swaggerapi/swagger-codegen-cli generate -l go
SPEC_GENERATOR = swaggerapi/swagger-codegen-cli generate -l openapi --additional-properties=outputFile
all: petstorepetstore: petstore/go.mod petstore.json
petstore.json:
@curl https://petstore.swagger.io/v2/swagger.json > petstore.json# Use a containerized Go Makefile and Dockerfile
# docker run --rm -v "$(PWD)/$(@D)":/usr/local/go/src/client golang:1.16 go build client%/go.mod: %.json
docker run --rm -v "$(PWD):/src" -w /src $(GOMOD_GENERATOR) \
-i $< -o $(@D) \
--additional-properties=generateInterfaces=true \
--additional-properties=GoSubmodule=true \
--additional-properties=packageName=$(@D) \
Related Content
- 2 years agovericomms
Recent Discussions
- 11 hours agomtiwari176
- 4 days agoankkashyap