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
If you use model like the one below, swag will not document it.
type User struct {
gorm.Model
// Username of the user
// @example johndoe
Username string json:"username"
// First name of the user
// @example John
FirstName string json:"first_name"
// Last name of the user
// @example Doe
LastName string json:"last_name"
// Email address of the user
// @examplejohn.doe@example.com
Email string json:"email"
// Password of the user (hashed)
// @example (not shown for security reasons)
Password string json:"password" swaggerignore:"true" // "-" excludes from JSON, swaggerignore excludes from Swagger docs
// Role of the user
// @example admin, user
Role string json:"role"
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If you use model like the one below, swag will not document it.
type User struct {
gorm.Model
// Username of the user
// @example johndoe
Username string
json:"username"
// First name of the user
// @example John
FirstName string
json:"first_name"
// Last name of the user
// @example Doe
LastName string
json:"last_name"
// Email address of the user
// @example john.doe@example.com
Email string
json:"email"
// Password of the user (hashed)
// @example (not shown for security reasons)
Password string
json:"password" swaggerignore:"true"
// "-" excludes from JSON, swaggerignore excludes from Swagger docs// Role of the user
// @example admin, user
Role string
json:"role"
}
2024/08/08 13:53:07 Generating models.User
2024/08/08 13:53:07 Error parsing type definition 'models.User': : cannot find type definition: gorm.Model
2024/08/08 13:53:07 Skipping 'models.User', recursion detected.
2024/08/08 13:53:07 Skipping 'models.User', recursion detected.
Beta Was this translation helpful? Give feedback.
All reactions