You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and here the error of the swag command (swag init --dir ./,./handlers) (Running on a docker but thje same append if running locally)
> [7/7] RUN swag init --dir ./,./handlers:
#0 0.545 2023/06/30 17:11:43 Generate swagger docs....
#0 0.545 2023/06/30 17:11:43 Generate general API Info, search dir:./
#0 1.030 2023/06/30 17:11:43 Generate general API Info, search dir:./handlers
#0 1.118 2023/06/30 17:11:43 Generating models.Todo
#0 1.118 2023/06/30 17:11:43 Error parsing type definition 'models.Todo': cannot find type definition: gorm.Model
#0 1.118 2023/06/30 17:11:43 ParseComment error in file /usr/src/app/handlers/todos.go :cannot find type definition: gorm.Model
For info here is my dockerfile:
FROM golang:1.20.2
WORKDIR /usr/src/app
RUN go install github.com/cosmtrek/air@latest
RUN go install github.com/swaggo/swag/cmd/swag@latest
COPY . .
RUN go mod tidy
RUN swag init --dir ./,./handlers
When using gorm as The ORM to use Postgresql the generation of the swagger documentation fail.
here is my todo model:
and here the error of the swag command (
swag init --dir ./,./handlers
) (Running on a docker but thje same append if running locally)For info here is my dockerfile:
And my go.mod file:
Does anyone have a solution ?
The text was updated successfully, but these errors were encountered: