code: func (t EnumType) Validate() error {
  	if t.Kind != KindEnum {
  		return errs.Errorf(`enum has a base type "%s" but needs "%s"`, t.Kind, KindEnum)
  	}
  	if !t.BaseType.Kind.IsSimpleType() {
  		return errs.Errorf(`enum type must have a simple component type and not "%s"`, t.Kind)
  	}
  	_, err := t.SetDefaultValue(t.DefaultValue)
  	if err != nil {
  		return errs.Wrapf(err, "failed to validate default value for kind %s: %+v (%[1]T)", t.Kind, t.DefaultValue)
  	}
  	// verify that we have a set of permitted values
  	if t.Values == nil || len(t.Values) <= 0 {
  		return errs.Errorf("enum type has no values: %+v", t)
  	}
  	for i, v := range t.Values {
  		_, err := t.ConvertToModel(v)
  		if err != nil {
  			return errs.Wrapf(err, `failed to convert value at position %d to kind "%s": %+v`, i, t.BaseType, v)
  		}
  	}
  	return nil
  }
docs: // Validate checks that the type of the enum is "enum", that the base type
  // itself a simple type (e.g. not a list or an enum), that the default value
  // matches the Kind of the BaseType, that the default value is in the list of
  // allowed values and that the Values are all of the base type.