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

Dynamically set swagger version with semantic-release #1844

Open
jyturley opened this issue Jul 18, 2024 · 0 comments
Open

Dynamically set swagger version with semantic-release #1844

jyturley opened this issue Jul 18, 2024 · 0 comments

Comments

@jyturley
Copy link

Describe the bug
Is there a way to set the swagger version at build time?

Currently , our repos leverage swag init to generate swagger docs. Currently the top level swagger versioning is defined through annotations like this:

// @title Service API Definition
// @version 1.12.4
// @description	...
// @BasePath /service/v1
func main() {}

This yields v1.12.4 in the swagger docs, as expected. The service uses embed to serve the swagger page.

However, is there a way to have define this 1.12.4 version dynamically? We would like to start using semantic-release, and are wondering how we can have github actions trigger a version increment without having to re-run swag init and rebuild the go service.

I am curious how other folks use swag init and dynamic versioning -- perhaps I am approaching this incorrectly. I appreciate any input -- thanks!

Your swag version
1.16.3

Your go version
go1.22.3 darwin/arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant