gofiber/swagger

need to run `swag init` every time to update schema

Closed this issue · 4 comments

When i run my app using go run main.go serve (i am using cobra cli framework) then the swagger.json is not update with the updated code (comments). I have to run swag init everytime.

@KunalSin9h This is clearly outlined in the documentation. You could use any number of task runners to run the swagger generation before running the server.

thanks,

task runners? i am using husky for generating swagger specs before commiting.
but i manually run swag --init before running the application.

@KunalSin9h you could use a makefile for instance and create an instruction to run swag init first before running go as so.

run:
	@swag init
	@go run main.go