Beispiel #1
0
func (m *TaskCard) validateTitle(formats strfmt.Registry) error {

	if err := validate.Required("title", "body", m.Title); err != nil {
		return err
	}

	if err := validate.MinLength("title", "body", string(*m.Title), 5); err != nil {
		return err
	}

	if err := validate.MaxLength("title", "body", string(*m.Title), 150); err != nil {
		return err
	}

	return nil
}
Beispiel #2
0
func (m *UserCard) validateScreenName(formats strfmt.Registry) error {

	if err := validate.Required("screenName", "body", m.ScreenName); err != nil {
		return err
	}

	if err := validate.MinLength("screenName", "body", string(*m.ScreenName), 3); err != nil {
		return err
	}

	if err := validate.MaxLength("screenName", "body", string(*m.ScreenName), 255); err != nil {
		return err
	}

	if err := validate.Pattern("screenName", "body", string(*m.ScreenName), `\w[\w_-]+`); err != nil {
		return err
	}

	return nil
}
Beispiel #3
0
func (m *Milestone) validateName(formats strfmt.Registry) error {

	if err := validate.Required("name", "body", m.Name); err != nil {
		return err
	}

	if err := validate.MinLength("name", "body", string(*m.Name), 3); err != nil {
		return err
	}

	if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil {
		return err
	}

	if err := validate.Pattern("name", "body", string(*m.Name), `[A-Za-z][\w- ]+`); err != nil {
		return err
	}

	return nil
}