Example #1
0
func (m *TaskCard) validateSeverity(formats strfmt.Registry) error {

	if swag.IsZero(m.Severity) { // not required
		return nil
	}

	if err := validate.MinimumInt("severity", "body", int64(m.Severity), 1, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("severity", "body", int64(m.Severity), 5, false); err != nil {
		return err
	}

	return nil
}
Example #2
0
func (m *UpdateUser) validateTagExpiration(formats strfmt.Registry) error {

	if swag.IsZero(m.TagExpiration) { // not required
		return nil
	}

	if err := validate.MinimumInt("tag_expiration", "body", int64(*m.TagExpiration), 0, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("tag_expiration", "body", int64(*m.TagExpiration), 2.592e+06, false); err != nil {
		return err
	}

	return nil
}