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
Describe the bug
When executing: swag init --md ./docs --parseInternal --parseDependency --parseDepth 2
Receiving error: ParseComment error in file /Users/morgan/leadgen/data-ms/routes/content.go :cannot find type definition: sql.NullTime
To Reproduce
Steps to reproduce the behavior:
Execute swag init --md ./docs --parseInternal --parseDependency --parseDepth 2 with a gorm model in your swagger comment spec.
Example:
Gorm Model:
import (
"gorm.io/gorm"
"time"
)
type Content struct {
gorm.Model
OrganisationId int `json:"organisation_id"`
ContentTypeId int `json:"content_type_id"`
AvailableDatetime *time.Time `json:"available_datetime"`
ExpiryDatetime *time.Time `json:"expiry_datetime"`
Pinned bool `json:"pinned"`
MediaId int `json:"media_id"`
}
Swagger Comment:
// @Summary List Content in Organisation
// @Description Get a list of content in the organisation.
// @Tags content
// @Produce json
// @Param orgId path int true "Organization ID" minimum(1)
// @Success 200 {array} models.Content
// @Router /organizations/{orgId}/content [get]
Expected behavior
Swagger docs to be generated successfully
You have to check your swag version by cmd swag --version.
The swag version means the version of the swag tool you are using, other than the dependent package version you have imported.
Describe the bug
When executing:
swag init --md ./docs --parseInternal --parseDependency --parseDepth 2
Receiving error:
ParseComment error in file /Users/morgan/leadgen/data-ms/routes/content.go :cannot find type definition: sql.NullTime
To Reproduce
Steps to reproduce the behavior:
Execute
swag init --md ./docs --parseInternal --parseDependency --parseDepth 2
with a gorm model in your swagger comment spec.Example:
Gorm Model:
Swagger Comment:
Expected behavior
Swagger docs to be generated successfully
Your swag version
Your go version
e.g. 1.21.5
Additional info:
I have tried the solution specified in #1228 with .swaggo file in the root of the project but am still getting this issue.
Gorm version: gorm.io/gorm v1.25.5
The text was updated successfully, but these errors were encountered: