Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when generating specs using Go 1.21.x #3062

Open
dannyskoog opened this issue Jan 16, 2024 · 2 comments
Open

Error when generating specs using Go 1.21.x #3062

dannyskoog opened this issue Jan 16, 2024 · 2 comments
Labels
generate spec Related to spec generation from code

Comments

@dannyskoog
Copy link

dannyskoog commented Jan 16, 2024

Problem statement

When trying to generate specs in a codebase with a go directive like go 1.21.5, the following error is returned:

err: exit status 1: stderr: go: errors parsing go.mod:
/go/src/github.com/voiapp/rms-gateway/go.mod:3: invalid go version '1.21.5': must match format 1.23

Steps to reproduce

Presumably whatever specs generation command. But in my case:
docker run --rm -v /Users/dannyskoog/GIT/go/src/rms-gateway:/go/src/github.com/voiapp/rms-gateway -w /go/src/github.com/voiapp/rms-gateway quay.io/goswagger/swagger:v0.30.5 generate spec --exclude-deps -i ./api/swagger-definitions.yaml -o ./api/swagger.json

Environment

swagger version: 0.30.5
go version: 1.21.5
OS: Ubuntu 22.04.3

@dannyskoog
Copy link
Author

I realised that the quay.io/goswagger/swagger:master Docker image seems to work.

The docs, although, implies (implicitly) that the latest tag should be used (see https://goswagger.io/install.html#docker-image-). Is that intentional, given the fact that the latest tag hasn't been updated in 7 months?

@fredbi fredbi added the generate spec Related to spec generation from code label Jan 24, 2024
@oliverpool
Copy link

Having a more recent tag would also help with Go 1.22: #3070 (different problem, but I guess the tag would solve both issues)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generate spec Related to spec generation from code
Projects
None yet
Development

No branches or pull requests

3 participants