code: func (f FieldDefinition) ConvertToModel(name string, value interface{}) (interface{}, error) {
  	// Overwrite value if default value if none was provided
  	if value == nil {
  		value = f.Type.GetDefaultValue()
  	}
  
  	if f.Required {
  		if value == nil {
  			return nil, fmt.Errorf("value for field %q must not be nil", name)
  		}
  		if f.Type.GetKind() == KindString {
  			sVal, ok := value.(string)
  			if !ok {
  				return nil, errs.Errorf("failed to convert '%+v' to string", spew.Sdump(value))
  			}
  			if strings.TrimSpace(sVal) == "" {
  				return nil, errs.Errorf("value for field %q must not be empty: \"%+v\"", name, value)
  			}
  		}
  	}
  	return f.Type.ConvertToModel(value)
  }
docs: // ConvertToModel converts a field value for use in the persistence layer