1 Star 0 Fork 0

gaogaoss/go-swagger

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
item.go 1.09 KB
Copy Edit Raw Blame History
gaogao authored 2024-07-30 09:49 +08:00 . first commit
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)
// Item item
// swagger:model item
type Item struct {
// completed
Completed bool `json:"completed,omitempty"`
// description
// Required: true
// Min Length: 1
Description *string `json:"description"`
// id
// Read Only: true
ID int64 `json:"id,omitempty"`
}
// Validate validates this item
func (m *Item) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDescription(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Item) validateDescription(formats strfmt.Registry) error {
if err := validate.Required("description", "body", m.Description); err != nil {
return err
}
if err := validate.MinLength("description", "body", string(*m.Description), 1); err != nil {
return err
}
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gaogaoss/go-swagger.git
git@gitee.com:gaogaoss/go-swagger.git
gaogaoss
go-swagger
go-swagger
da1ca328b83f

Search